mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
新增了智能控制的接口
This commit is contained in:
parent
cb6140a904
commit
433ef91d35
@ -0,0 +1,92 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ics.admin.domain.WisdomRoom;
|
||||
import com.ics.admin.service.IWisdomRoomService;
|
||||
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.WisdomDevice;
|
||||
import com.ics.admin.service.IWisdomDeviceService;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能设备 提供者
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/wisdomDevice")
|
||||
public class WisdomDeviceController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWisdomDeviceService wisdomDeviceService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomRoomService wisdomRoomService;
|
||||
|
||||
/**
|
||||
* 查询智能设备
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public WisdomDevice get(@PathVariable("id") Long id) {
|
||||
return wisdomDeviceService.selectWisdomDeviceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询智能设备列表
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomDevice:list")
|
||||
@GetMapping("list")
|
||||
public R list(WisdomDevice wisdomDevice) {
|
||||
startPage();
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
if (CollUtil.isNotEmpty(wisdomDevices)){
|
||||
for (WisdomDevice device : wisdomDevices) {
|
||||
WisdomRoom wisdomRoom = wisdomRoomService.selectWisdomRoomById(device.getWisdomRoomId());
|
||||
if (wisdomRoom != null) device.setContentName(wisdomRoom.getMeetingName());
|
||||
}
|
||||
}
|
||||
return result(wisdomDevices);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存智能设备
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomDevice:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody WisdomDevice wisdomDevice) {
|
||||
return toAjax(wisdomDeviceService.insertWisdomDevice(wisdomDevice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存智能设备
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomDevice:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody WisdomDevice wisdomDevice) {
|
||||
return toAjax(wisdomDeviceService.updateWisdomDevice(wisdomDevice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能设备
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomDevice:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(wisdomDeviceService.deleteWisdomDeviceByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.service.IWisdomRoomService;
|
||||
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.WisdomPanel;
|
||||
import com.ics.admin.service.IWisdomPanelService;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 情景面板 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("wisdomPanel")
|
||||
public class WisdomPanelController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWisdomPanelService wisdomPanelService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomRoomService wisdomRoomService;
|
||||
|
||||
/**
|
||||
* 查询情景面板
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public WisdomPanel get(@PathVariable("id") Long id) {
|
||||
return wisdomPanelService.selectWisdomPanelById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询情景面板列表
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("list")
|
||||
public R list(WisdomPanel wisdomPanel) {
|
||||
startPage();
|
||||
List<WisdomPanel> wisdomPanels = wisdomPanelService.selectWisdomPanelList(wisdomPanel);
|
||||
for (WisdomPanel panel : wisdomPanels) {
|
||||
panel.setMeetingName(wisdomRoomService.selectWisdomRoomById(panel.getWisdomRoom()).getMeetingName());
|
||||
}
|
||||
|
||||
return result(wisdomPanels);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存情景面板
|
||||
*/
|
||||
// @RequiresPermissions("admin:panel:add")
|
||||
@Ignore
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody WisdomPanel wisdomPanel) {
|
||||
return toAjax(wisdomPanelService.insertWisdomPanel(wisdomPanel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存情景面板
|
||||
*/
|
||||
@RequiresPermissions("admin:panel:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody WisdomPanel wisdomPanel) {
|
||||
return toAjax(wisdomPanelService.updateWisdomPanel(wisdomPanel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除情景面板
|
||||
*/
|
||||
@RequiresPermissions("admin:panel:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(wisdomPanelService.deleteWisdomPanelByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
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.WisdomPanelEquipment;
|
||||
import com.ics.admin.service.IWisdomPanelEquipmentService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 窗帘关联 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("panelEquipment")
|
||||
public class WisdomPanelEquipmentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWisdomPanelEquipmentService wisdomPanelEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询窗帘关联
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public WisdomPanelEquipment get(@PathVariable("id") Long id) {
|
||||
return wisdomPanelEquipmentService.selectWisdomPanelEquipmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询窗帘关联列表
|
||||
*/
|
||||
@RequiresPermissions("admin:equipment:list")
|
||||
@GetMapping("list")
|
||||
public R list(WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
startPage();
|
||||
return result(wisdomPanelEquipmentService.selectWisdomPanelEquipmentList(wisdomPanelEquipment));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存窗帘关联
|
||||
*/
|
||||
@RequiresPermissions("admin:equipment:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
return toAjax(wisdomPanelEquipmentService.insertWisdomPanelEquipment(wisdomPanelEquipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存窗帘关联
|
||||
*/
|
||||
@RequiresPermissions("admin:equipment:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
return toAjax(wisdomPanelEquipmentService.updateWisdomPanelEquipment(wisdomPanelEquipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除窗帘关联
|
||||
*/
|
||||
@RequiresPermissions("admin:equipment:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(wisdomPanelEquipmentService.deleteWisdomPanelEquipmentByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IWisdomStaffService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
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.WisdomRoom;
|
||||
import com.ics.admin.service.IWisdomRoomService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 智能房间 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/wisdomRoom")
|
||||
public class WisdomRoomController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWisdomRoomService wisdomRoomService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomStaffService wisdomStaffService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
/**
|
||||
* 查询智能房间
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public WisdomRoom get(@PathVariable("id") Long id) {
|
||||
return wisdomRoomService.selectWisdomRoomById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询智能房间列表
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomRoom:list")
|
||||
@GetMapping("list")
|
||||
public R list(WisdomRoom wisdomRoom) {
|
||||
startPage();
|
||||
List<WisdomRoom> wisdomRooms = wisdomRoomService.selectList(wisdomRoom);
|
||||
for (WisdomRoom room : wisdomRooms) {
|
||||
List<Long> collect = wisdomStaffService.selectWisdomStaffByRoomId(room.getId());
|
||||
room.setStaffId(collect);
|
||||
room.setStaffLists(customerStaffService.selectList());
|
||||
}
|
||||
return result(wisdomRooms);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存智能房间
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomRoom:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody WisdomRoom wisdomRoom) {
|
||||
int i = wisdomRoomService.insertWisdomRoom(wisdomRoom);
|
||||
Long id = wisdomRoom.getId();
|
||||
WisdomStaff wisdomStaff = new WisdomStaff();
|
||||
for (Long s : wisdomRoom.getStaffId()) {
|
||||
wisdomStaff.setWisdomRoomId(id);
|
||||
wisdomStaff.setStaffId(s);
|
||||
wisdomStaffService.insertWisdomStaff(wisdomStaff);
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存智能房间
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomRoom:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody WisdomRoom wisdomRoom) {
|
||||
int i = wisdomRoomService.updateWisdomRoom(wisdomRoom);
|
||||
WisdomStaff wisdomStaff = new WisdomStaff();
|
||||
List<Long> ids = wisdomStaffService.selectWisdomStaffListByRoomId(wisdomRoom.getId());
|
||||
String joinStr = StringUtils.join(ids, ",");
|
||||
if (ids.size()>0) wisdomStaffService.deleteWisdomStaffByIds(joinStr);
|
||||
for (Long s : wisdomRoom.getStaffId()) {
|
||||
wisdomStaff.setWisdomRoomId(wisdomRoom.getId());
|
||||
wisdomStaff.setStaffId(s);
|
||||
wisdomStaffService.insertWisdomStaff(wisdomStaff);
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能房间
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomRoom:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(wisdomRoomService.deleteWisdomRoomByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户列表
|
||||
*/
|
||||
@RequiresPermissions("wisdom:wisdomRoom:view")
|
||||
@GetMapping("selectStaff")
|
||||
public R selectStaff() {
|
||||
List<IcsCustomerStaff> customerStaffs = customerStaffService.selectList();
|
||||
return R.data(customerStaffs);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
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.WisdomStaff;
|
||||
import com.ics.admin.service.IWisdomStaffService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 房间用户关联 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("staff")
|
||||
public class WisdomStaffController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWisdomStaffService wisdomStaffService;
|
||||
|
||||
/**
|
||||
* 查询房间用户关联
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public WisdomStaff get(@PathVariable("id") Long id) {
|
||||
return wisdomStaffService.selectWisdomStaffById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询房间用户关联列表
|
||||
*/
|
||||
@RequiresPermissions("admin:staff:list")
|
||||
@GetMapping("list")
|
||||
public R list(WisdomStaff wisdomStaff) {
|
||||
startPage();
|
||||
return result(wisdomStaffService.selectWisdomStaffList(wisdomStaff));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存房间用户关联
|
||||
*/
|
||||
@RequiresPermissions("admin:staff:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody WisdomStaff wisdomStaff) {
|
||||
return toAjax(wisdomStaffService.insertWisdomStaff(wisdomStaff));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存房间用户关联
|
||||
*/
|
||||
@RequiresPermissions("admin:staff:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody WisdomStaff wisdomStaff) {
|
||||
return toAjax(wisdomStaffService.updateWisdomStaff(wisdomStaff));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除房间用户关联
|
||||
*/
|
||||
@RequiresPermissions("admin:staff:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(wisdomStaffService.deleteWisdomStaffByIds(ids));
|
||||
}
|
||||
|
||||
}
|
21
ics-admin/src/main/java/com/ics/admin/domain/DeviceVo.java
Normal file
21
ics-admin/src/main/java/com/ics/admin/domain/DeviceVo.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeviceVo {
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private Boolean actionArg;
|
||||
|
||||
private Integer bir;
|
||||
|
||||
private Integer colourTemperature;
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
private String coverType;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 智能设备对象 tb_wisdom_device
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_wisdom_device")
|
||||
public class WisdomDevice extends BaseEntity<WisdomDevice> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备分类 */
|
||||
private String type;
|
||||
|
||||
private String typeName;
|
||||
|
||||
/** 设备名称 */
|
||||
private String equipmentName;
|
||||
|
||||
/** 设备状态 0在线 1损坏 2离线 */
|
||||
private Long status;
|
||||
|
||||
/** 设备编号 */
|
||||
private String equipmentNum;
|
||||
|
||||
/** 设备图片 */
|
||||
private String pic;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String ip;
|
||||
|
||||
/** 园区ID */
|
||||
private Long parkId;
|
||||
|
||||
/** 会议室id */
|
||||
private Long wisdomRoomId;
|
||||
|
||||
/** 会议室名称 */
|
||||
private String contentName;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 情景面板对象 tb_wisdom_panel
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_wisdom_panel")
|
||||
public class WisdomPanel extends BaseEntity<WisdomPanel> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 面板名称 */
|
||||
private String panelName;
|
||||
|
||||
/** 按钮id */
|
||||
private Integer buttonId;
|
||||
|
||||
/** 房间id */
|
||||
private Long wisdomRoom;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String meetingName;
|
||||
|
||||
/** 控制面板id */
|
||||
private String panelId;
|
||||
|
||||
private String img;
|
||||
|
||||
private String imgOpen;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 窗帘关联对象 tb_wisdom_panel_equipment
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_wisdom_panel_equipment")
|
||||
public class WisdomPanelEquipment extends BaseEntity<WisdomPanelEquipment> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 面板id */
|
||||
private Long panelId;
|
||||
|
||||
/** 设备id */
|
||||
private Long equipmentId;
|
||||
|
||||
/** 类型,open,close */
|
||||
private String type;
|
||||
|
||||
}
|
57
ics-admin/src/main/java/com/ics/admin/domain/WisdomRoom.java
Normal file
57
ics-admin/src/main/java/com/ics/admin/domain/WisdomRoom.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能房间对象 tb_wisdom_room
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_wisdom_room")
|
||||
public class WisdomRoom extends BaseEntity<WisdomRoom> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 类型(会议室、办公室、茶室、路演厅) */
|
||||
private String type;
|
||||
|
||||
/** 名称 */
|
||||
private String meetingName;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endDate;
|
||||
|
||||
/** 金额备注 */
|
||||
private String remake;
|
||||
|
||||
private String img;
|
||||
|
||||
/** 园区ID */
|
||||
private Long parkId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Long> staffId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer deviceNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer panelNum;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<IcsCustomerStaff> staffLists;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long staffIds;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 房间用户关联对象 tb_wisdom_staff
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_wisdom_staff")
|
||||
public class WisdomStaff extends BaseEntity<WisdomStaff> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 房间id */
|
||||
private Long wisdomRoomId;
|
||||
|
||||
/** 用户id */
|
||||
private Long staffId;
|
||||
|
||||
/** 园区ID */
|
||||
private Long parkId;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.WisdomDevice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能设备Mapper接口
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface WisdomDeviceMapper extends BaseMapper<WisdomDevice> {
|
||||
/**
|
||||
* 查询智能设备
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 智能设备
|
||||
*/
|
||||
WisdomDevice selectWisdomDeviceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询智能设备列表
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 智能设备集合
|
||||
*/
|
||||
List<WisdomDevice> selectWisdomDeviceList(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 新增智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomDevice(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 修改智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomDevice(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 删除智能设备
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomDeviceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除智能设备
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomDeviceByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.WisdomPanelEquipment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 窗帘关联Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface WisdomPanelEquipmentMapper extends BaseMapper<WisdomPanelEquipment> {
|
||||
/**
|
||||
* 查询窗帘关联
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 窗帘关联
|
||||
*/
|
||||
WisdomPanelEquipment selectWisdomPanelEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询窗帘关联列表
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 窗帘关联集合
|
||||
*/
|
||||
List<WisdomPanelEquipment> selectWisdomPanelEquipmentList(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 新增窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 修改窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 删除窗帘关联
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除窗帘关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelEquipmentByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.WisdomPanel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 情景面板Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface WisdomPanelMapper extends BaseMapper<WisdomPanel> {
|
||||
/**
|
||||
* 查询情景面板
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 情景面板
|
||||
*/
|
||||
WisdomPanel selectWisdomPanelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询情景面板列表
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 情景面板集合
|
||||
*/
|
||||
List<WisdomPanel> selectWisdomPanelList(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 新增情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomPanel(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 修改情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomPanel(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 删除情景面板
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除情景面板
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.WisdomRoom;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能房间Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface WisdomRoomMapper extends BaseMapper<WisdomRoom> {
|
||||
/**
|
||||
* 查询智能房间
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 智能房间
|
||||
*/
|
||||
WisdomRoom selectWisdomRoomById(Long id);
|
||||
|
||||
/**
|
||||
* 查询智能房间列表
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 智能房间集合
|
||||
*/
|
||||
List<WisdomRoom> selectWisdomRoomList(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 新增智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomRoom(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 修改智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomRoom(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 删除智能房间
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomRoomById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除智能房间
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomRoomByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 房间用户关联Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface WisdomStaffMapper extends BaseMapper<WisdomStaff> {
|
||||
/**
|
||||
* 查询房间用户关联
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 房间用户关联
|
||||
*/
|
||||
WisdomStaff selectWisdomStaffById(Long id);
|
||||
|
||||
/**
|
||||
* 查询房间用户关联列表
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 房间用户关联集合
|
||||
*/
|
||||
List<WisdomStaff> selectWisdomStaffList(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 新增房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomStaff(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 修改房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomStaff(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 删除房间用户关联
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomStaffById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除房间用户关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomStaffByIds(String[] ids);
|
||||
}
|
@ -90,5 +90,7 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
||||
|
||||
IcsCustomerStaff selectUserByMobile(String phone);
|
||||
|
||||
List<IcsCustomerStaff> selectList();
|
||||
|
||||
// IcsCustomerStaff selectUserByMobileAndParkId(String phoneNumber, String parkId);
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomDevice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能设备Service接口
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IWisdomDeviceService extends IService<WisdomDevice> {
|
||||
/**
|
||||
* 查询智能设备
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 智能设备
|
||||
*/
|
||||
WisdomDevice selectWisdomDeviceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询智能设备列表
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 智能设备集合
|
||||
*/
|
||||
List<WisdomDevice> selectWisdomDeviceList(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 新增智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomDevice(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 修改智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomDevice(WisdomDevice wisdomDevice);
|
||||
|
||||
/**
|
||||
* 批量删除智能设备
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomDeviceByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除智能设备信息
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomDeviceById(Long id);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomPanelEquipment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 窗帘关联Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
public interface IWisdomPanelEquipmentService extends IService<WisdomPanelEquipment> {
|
||||
/**
|
||||
* 查询窗帘关联
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 窗帘关联
|
||||
*/
|
||||
WisdomPanelEquipment selectWisdomPanelEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询窗帘关联列表
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 窗帘关联集合
|
||||
*/
|
||||
List<WisdomPanelEquipment> selectWisdomPanelEquipmentList(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 新增窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 修改窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment);
|
||||
|
||||
/**
|
||||
* 批量删除窗帘关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelEquipmentByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除窗帘关联信息
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelEquipmentById(Long id);
|
||||
|
||||
List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(String panelId);
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomPanel;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 情景面板Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
public interface IWisdomPanelService extends IService<WisdomPanel> {
|
||||
/**
|
||||
* 查询情景面板
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 情景面板
|
||||
*/
|
||||
WisdomPanel selectWisdomPanelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询情景面板列表
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 情景面板集合
|
||||
*/
|
||||
List<WisdomPanel> selectWisdomPanelList(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 新增情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomPanel(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 修改情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomPanel(WisdomPanel wisdomPanel);
|
||||
|
||||
/**
|
||||
* 批量删除情景面板
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除情景面板信息
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomPanelById(Long id);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomRoom;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能房间Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IWisdomRoomService extends IService<WisdomRoom> {
|
||||
/**
|
||||
* 查询智能房间
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 智能房间
|
||||
*/
|
||||
WisdomRoom selectWisdomRoomById(Long id);
|
||||
|
||||
/**
|
||||
* 查询智能房间列表
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 智能房间集合
|
||||
*/
|
||||
List<WisdomRoom> selectWisdomRoomList(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 新增智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomRoom(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 修改智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomRoom(WisdomRoom wisdomRoom);
|
||||
|
||||
/**
|
||||
* 批量删除智能房间
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomRoomByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除智能房间信息
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomRoomById(Long id);
|
||||
|
||||
List<WisdomRoom> selectList(WisdomRoom wisdomRoom);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 房间用户关联Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IWisdomStaffService extends IService<WisdomStaff> {
|
||||
/**
|
||||
* 查询房间用户关联
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 房间用户关联
|
||||
*/
|
||||
WisdomStaff selectWisdomStaffById(Long id);
|
||||
|
||||
/**
|
||||
* 查询房间用户关联列表
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 房间用户关联集合
|
||||
*/
|
||||
List<WisdomStaff> selectWisdomStaffList(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 新增房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWisdomStaff(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 修改房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateWisdomStaff(WisdomStaff wisdomStaff);
|
||||
|
||||
/**
|
||||
* 批量删除房间用户关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomStaffByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除房间用户关联信息
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWisdomStaffById(Long id);
|
||||
|
||||
int deleteWisdomStaffByRoomId(Long id);
|
||||
|
||||
List<Long> selectWisdomStaffListByRoomId(Long id);
|
||||
|
||||
List<Long> selectWisdomStaffByRoomId(Long id);
|
||||
}
|
@ -299,6 +299,11 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
return icsCustomerStaffMapper.selectUserByMobile(phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> selectList() {
|
||||
|
||||
return baseMapper.selectList(null);
|
||||
}
|
||||
|
||||
|
||||
//根据企业查询对应的设备
|
||||
|
@ -0,0 +1,93 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
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.WisdomDeviceMapper;
|
||||
import com.ics.admin.domain.WisdomDevice;
|
||||
import com.ics.admin.service.IWisdomDeviceService;
|
||||
|
||||
/**
|
||||
* 智能设备Service业务层处理
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class WisdomDeviceServiceImpl extends ServiceImpl<WisdomDeviceMapper, WisdomDevice> implements IWisdomDeviceService {
|
||||
@Autowired
|
||||
private WisdomDeviceMapper wisdomDeviceMapper;
|
||||
|
||||
/**
|
||||
* 查询智能设备
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 智能设备
|
||||
*/
|
||||
@Override
|
||||
public WisdomDevice selectWisdomDeviceById(Long id) {
|
||||
return wisdomDeviceMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询智能设备列表
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 智能设备
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomDevice> selectWisdomDeviceList(WisdomDevice wisdomDevice) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(wisdomDevice.getWisdomRoomId() !=null,"wisdom_room_id",wisdomDevice.getWisdomRoomId());
|
||||
return wisdomDeviceMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWisdomDevice(WisdomDevice wisdomDevice) {
|
||||
return wisdomDeviceMapper.insert(wisdomDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改智能设备
|
||||
*
|
||||
* @param wisdomDevice 智能设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWisdomDevice(WisdomDevice wisdomDevice) {
|
||||
return wisdomDeviceMapper.updateById(wisdomDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能设备对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomDeviceByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return wisdomDeviceMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能设备信息
|
||||
*
|
||||
* @param id 智能设备ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomDeviceById(Long id) {
|
||||
return wisdomDeviceMapper.deleteWisdomDeviceById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
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.WisdomPanelEquipmentMapper;
|
||||
import com.ics.admin.domain.WisdomPanelEquipment;
|
||||
import com.ics.admin.service.IWisdomPanelEquipmentService;
|
||||
|
||||
/**
|
||||
* 窗帘关联Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Service
|
||||
public class WisdomPanelEquipmentServiceImpl extends ServiceImpl<WisdomPanelEquipmentMapper, WisdomPanelEquipment> implements IWisdomPanelEquipmentService {
|
||||
@Autowired
|
||||
private WisdomPanelEquipmentMapper wisdomPanelEquipmentMapper;
|
||||
|
||||
/**
|
||||
* 查询窗帘关联
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 窗帘关联
|
||||
*/
|
||||
@Override
|
||||
public WisdomPanelEquipment selectWisdomPanelEquipmentById(Long id) {
|
||||
return wisdomPanelEquipmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询窗帘关联列表
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 窗帘关联
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomPanelEquipment> selectWisdomPanelEquipmentList(WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return wisdomPanelEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
return wisdomPanelEquipmentMapper.insert(wisdomPanelEquipment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改窗帘关联
|
||||
*
|
||||
* @param wisdomPanelEquipment 窗帘关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWisdomPanelEquipment(WisdomPanelEquipment wisdomPanelEquipment) {
|
||||
return wisdomPanelEquipmentMapper.updateById(wisdomPanelEquipment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除窗帘关联对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomPanelEquipmentByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return wisdomPanelEquipmentMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除窗帘关联信息
|
||||
*
|
||||
* @param id 窗帘关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomPanelEquipmentById(Long id) {
|
||||
return wisdomPanelEquipmentMapper.deleteWisdomPanelEquipmentById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(String panelId) {
|
||||
|
||||
QueryWrapper<WisdomPanelEquipment> wrapper = new QueryWrapper<WisdomPanelEquipment>().eq("panel_id", panelId);
|
||||
return wisdomPanelEquipmentMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
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.WisdomPanelMapper;
|
||||
import com.ics.admin.domain.WisdomPanel;
|
||||
import com.ics.admin.service.IWisdomPanelService;
|
||||
|
||||
/**
|
||||
* 情景面板Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Service
|
||||
public class WisdomPanelServiceImpl extends ServiceImpl<WisdomPanelMapper, WisdomPanel> implements IWisdomPanelService {
|
||||
@Autowired
|
||||
private WisdomPanelMapper wisdomPanelMapper;
|
||||
|
||||
/**
|
||||
* 查询情景面板
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 情景面板
|
||||
*/
|
||||
@Override
|
||||
public WisdomPanel selectWisdomPanelById(Long id) {
|
||||
return wisdomPanelMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询情景面板列表
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 情景面板
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomPanel> selectWisdomPanelList(WisdomPanel wisdomPanel) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(wisdomPanel.getWisdomRoom() !=null,"wisdom_room",wisdomPanel.getWisdomRoom());
|
||||
return wisdomPanelMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWisdomPanel(WisdomPanel wisdomPanel) {
|
||||
return wisdomPanelMapper.insert(wisdomPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改情景面板
|
||||
*
|
||||
* @param wisdomPanel 情景面板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWisdomPanel(WisdomPanel wisdomPanel) {
|
||||
return wisdomPanelMapper.updateById(wisdomPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除情景面板对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomPanelByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return wisdomPanelMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除情景面板信息
|
||||
*
|
||||
* @param id 情景面板ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomPanelById(Long id) {
|
||||
return wisdomPanelMapper.deleteWisdomPanelById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
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.WisdomRoomMapper;
|
||||
import com.ics.admin.domain.WisdomRoom;
|
||||
import com.ics.admin.service.IWisdomRoomService;
|
||||
|
||||
/**
|
||||
* 智能房间Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class WisdomRoomServiceImpl extends ServiceImpl<WisdomRoomMapper, WisdomRoom> implements IWisdomRoomService {
|
||||
@Autowired
|
||||
private WisdomRoomMapper wisdomRoomMapper;
|
||||
|
||||
/**
|
||||
* 查询智能房间
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 智能房间
|
||||
*/
|
||||
@Override
|
||||
public WisdomRoom selectWisdomRoomById(Long id) {
|
||||
return wisdomRoomMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询智能房间列表
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 智能房间
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomRoom> selectWisdomRoomList(WisdomRoom wisdomRoom) {
|
||||
return wisdomRoomMapper.selectWisdomRoomList(wisdomRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWisdomRoom(WisdomRoom wisdomRoom) {
|
||||
return wisdomRoomMapper.insert(wisdomRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改智能房间
|
||||
*
|
||||
* @param wisdomRoom 智能房间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWisdomRoom(WisdomRoom wisdomRoom) {
|
||||
return wisdomRoomMapper.updateById(wisdomRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能房间对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomRoomByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return wisdomRoomMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除智能房间信息
|
||||
*
|
||||
* @param id 智能房间ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomRoomById(Long id) {
|
||||
return wisdomRoomMapper.deleteWisdomRoomById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WisdomRoom> selectList(WisdomRoom wisdomRoom) {
|
||||
|
||||
QueryWrapper<WisdomRoom> queryWrapper = new QueryWrapper<>();
|
||||
return wisdomRoomMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.WisdomStaffMapper;
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.ics.admin.service.IWisdomStaffService;
|
||||
|
||||
/**
|
||||
* 房间用户关联Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class WisdomStaffServiceImpl extends ServiceImpl<WisdomStaffMapper, WisdomStaff> implements IWisdomStaffService {
|
||||
@Autowired
|
||||
private WisdomStaffMapper wisdomStaffMapper;
|
||||
|
||||
/**
|
||||
* 查询房间用户关联
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 房间用户关联
|
||||
*/
|
||||
@Override
|
||||
public WisdomStaff selectWisdomStaffById(Long id) {
|
||||
return wisdomStaffMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询房间用户关联列表
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 房间用户关联
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomStaff> selectWisdomStaffList(WisdomStaff wisdomStaff) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return wisdomStaffMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWisdomStaff(WisdomStaff wisdomStaff) {
|
||||
return wisdomStaffMapper.insert(wisdomStaff);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改房间用户关联
|
||||
*
|
||||
* @param wisdomStaff 房间用户关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWisdomStaff(WisdomStaff wisdomStaff) {
|
||||
return wisdomStaffMapper.updateById(wisdomStaff);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除房间用户关联对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomStaffByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return wisdomStaffMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除房间用户关联信息
|
||||
*
|
||||
* @param id 房间用户关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWisdomStaffById(Long id) {
|
||||
return wisdomStaffMapper.deleteWisdomStaffById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWisdomStaffByRoomId(Long id) {
|
||||
|
||||
UpdateWrapper<WisdomStaff> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("wisdom_room_id",id);
|
||||
return wisdomStaffMapper.delete(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectWisdomStaffListByRoomId(Long id) {
|
||||
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("wisdom_room_id",id);
|
||||
List<WisdomStaff> wisdomStaffs = wisdomStaffMapper.selectList(wrapper);
|
||||
List<Long> collect = wisdomStaffs.stream().map(WisdomStaff::getId).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectWisdomStaffByRoomId(Long id) {
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("wisdom_room_id",id);
|
||||
List<WisdomStaff> wisdomStaffs = wisdomStaffMapper.selectList(wrapper);
|
||||
List<Long> collect = wisdomStaffs.stream().map(WisdomStaff::getStaffId).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
}
|
@ -71,7 +71,6 @@
|
||||
r.remark,
|
||||
r.worker_score,
|
||||
r.worker_id,
|
||||
r.customer_id,
|
||||
r.create_by,
|
||||
r.create_time,
|
||||
r.update_by,
|
||||
|
121
ics-admin/src/main/resources/mapper/admin/WisdomDeviceMapper.xml
Normal file
121
ics-admin/src/main/resources/mapper/admin/WisdomDeviceMapper.xml
Normal file
@ -0,0 +1,121 @@
|
||||
<?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.WisdomDeviceMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.WisdomDevice" id="WisdomDeviceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="equipmentNum" column="equipment_num" />
|
||||
<result property="pic" column="pic" />
|
||||
<result property="typeName" column="type_name" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="wisdomRoomId" column="wisdom_room_id" />
|
||||
<result property="contentName" column="content_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWisdomDeviceVo">
|
||||
SELECT id, type, equipment_name,type_name, status,wisdom_room_id, equipment_num, pic, delete_flag, create_by, create_time, update_by, update_time, ip, tenant_id, park_id, content_id, content_name FROM tb_wisdom_device
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomDeviceList" parameterType="WisdomDevice" resultMap="WisdomDeviceResult">
|
||||
<include refid="selectWisdomDeviceVo"/>
|
||||
<where>
|
||||
<if test="equipmentName != null and equipmentName != ''"> AND equipment_name LIKE CONCAT('%', #{equipmentName}, '%')</if>
|
||||
<if test="contentName != null and contentName != ''"> AND content_name LIKE CONCAT('%', #{contentName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWisdomDeviceById" parameterType="Long" resultMap="WisdomDeviceResult">
|
||||
<include refid="selectWisdomDeviceVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWisdomDevice" parameterType="WisdomDevice" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_wisdom_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null ">type,</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
|
||||
<if test="status != null ">status,</if>
|
||||
<if test="equipmentNum != null and equipmentNum != ''">equipment_num,</if>
|
||||
<if test="pic != null and pic != ''">pic,</if>
|
||||
<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="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="ip != null and ip != ''">ip,</if>
|
||||
<if test="tenantId != null ">tenant_id,</if>
|
||||
<if test="typeName != null ">type_name,</if>
|
||||
<if test="wisdomRoomId != null ">wisdom_room_id,</if>
|
||||
<if test="parkId != null ">park_id,</if>
|
||||
<if test="contentId != null ">content_id,</if>
|
||||
<if test="contentName != null and contentName != ''">content_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null ">#{type},</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
|
||||
<if test="status != null ">#{status},</if>
|
||||
<if test="equipmentNum != null and equipmentNum != ''">#{equipmentNum},</if>
|
||||
<if test="pic != null and pic != ''">#{pic},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="typeName != null ">#{typeName},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="ip != null and ip != ''">#{ip},</if>
|
||||
<if test="wisdomRoomId != null and wisdomRoomId != ''">#{wisdom_room_id},</if>
|
||||
<if test="tenantId != null ">#{tenantId},</if>
|
||||
<if test="parkId != null ">#{parkId},</if>
|
||||
<if test="contentId != null ">#{contentId},</if>
|
||||
<if test="contentName != null and contentName != ''">#{contentName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWisdomDevice" parameterType="WisdomDevice">
|
||||
UPDATE tb_wisdom_device
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="type != null ">type = #{type},</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
|
||||
<if test="status != null ">status = #{status},</if>
|
||||
<if test="equipmentNum != null and equipmentNum != ''">equipment_num = #{equipmentNum},</if>
|
||||
<if test="pic != null and pic != ''">pic = #{pic},</if>
|
||||
<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="typeName != null ">type_name = #{typeName},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="ip != null and ip != ''">ip = #{ip},</if>
|
||||
<if test="wisdomRoomId != null and wisdomRoomId != ''">wisdom_room_id = #{wisdomRoomId},</if>
|
||||
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
||||
<if test="parkId != null ">park_id = #{parkId},</if>
|
||||
<if test="contentId != null ">content_id = #{contentId},</if>
|
||||
<if test="contentName != null and contentName != ''">content_name = #{contentName},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWisdomDeviceById" parameterType="Long">
|
||||
DELETE FROM tb_wisdom_device WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWisdomDeviceByIds" parameterType="String">
|
||||
DELETE FROM tb_wisdom_device where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,68 @@
|
||||
<?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.WisdomPanelEquipmentMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.WisdomPanelEquipment" id="WisdomPanelEquipmentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="panelId" column="panel_id" />
|
||||
<result property="equipmentId" column="equipment_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="type" column="type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWisdomPanelEquipmentVo">
|
||||
SELECT id, panel_id, equipment_id, create_time, type FROM tb_wisdom_panel_equipment
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomPanelEquipmentList" parameterType="WisdomPanelEquipment" resultMap="WisdomPanelEquipmentResult">
|
||||
<include refid="selectWisdomPanelEquipmentVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWisdomPanelEquipmentById" parameterType="Long" resultMap="WisdomPanelEquipmentResult">
|
||||
<include refid="selectWisdomPanelEquipmentVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWisdomPanelEquipment" parameterType="WisdomPanelEquipment" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_wisdom_panel_equipment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="panelId != null ">panel_id,</if>
|
||||
<if test="equipmentId != null ">equipment_id,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="panelId != null ">#{panelId},</if>
|
||||
<if test="equipmentId != null ">#{equipmentId},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWisdomPanelEquipment" parameterType="WisdomPanelEquipment">
|
||||
UPDATE tb_wisdom_panel_equipment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="panelId != null ">panel_id = #{panelId},</if>
|
||||
<if test="equipmentId != null ">equipment_id = #{equipmentId},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWisdomPanelEquipmentById" parameterType="Long">
|
||||
DELETE FROM tb_wisdom_panel_equipment WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWisdomPanelEquipmentByIds" parameterType="String">
|
||||
DELETE FROM tb_wisdom_panel_equipment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,81 @@
|
||||
<?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.WisdomPanelMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.WisdomPanel" id="WisdomPanelResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="panelName" column="panel_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="buttonId" column="button_id" />
|
||||
<result property="wisdomRoom" column="wisdom_room" />
|
||||
<result property="img" column="img" />
|
||||
<result property="imgOpen" column="imgOpen" />
|
||||
<result property="panelId" column="panel_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWisdomPanelVo">
|
||||
SELECT id, panel_name, create_time, button_id, wisdom_room, panel_id FROM tb_wisdom_panel
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomPanelList" parameterType="WisdomPanel" resultMap="WisdomPanelResult">
|
||||
<include refid="selectWisdomPanelVo"/>
|
||||
<where>
|
||||
<if test="panelName != null and panelName != ''"> AND panel_name LIKE CONCAT('%', #{panelName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWisdomPanelById" parameterType="Long" resultMap="WisdomPanelResult">
|
||||
<include refid="selectWisdomPanelVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWisdomPanel" parameterType="WisdomPanel" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_wisdom_panel
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="panelName != null and panelName != ''">panel_name,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="buttonId != null ">button_id,</if>
|
||||
<if test="wisdomRoom != null ">wisdom_room,</if>
|
||||
<if test="img != null ">img,</if>
|
||||
<if test="imgOpen != null ">img_open,</if>
|
||||
<if test="panelId != null ">panel_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="panelName != null and panelName != ''">#{panelName},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="buttonId != null ">#{buttonId},</if>
|
||||
<if test="wisdomRoom != null ">#{wisdomRoom},</if>
|
||||
<if test="img != null ">#{img},</if>
|
||||
<if test="imgOpen != null ">#{imgOpen},</if>
|
||||
<if test="panelId != null ">#{panelId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWisdomPanel" parameterType="WisdomPanel">
|
||||
UPDATE tb_wisdom_panel
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="panelName != null and panelName != ''">panel_name = #{panelName},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="buttonId != null ">button_id = #{buttonId},</if>
|
||||
<if test="wisdomRoom != null ">wisdom_room = #{wisdomRoom},</if>
|
||||
<if test="img != null ">img = #{img},</if>
|
||||
<if test="imgOpen != null ">img_open = #{imgOpen},</if>
|
||||
<if test="panelId != null ">panel_id = #{panelId},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWisdomPanelById" parameterType="Long">
|
||||
DELETE FROM tb_wisdom_panel WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWisdomPanelByIds" parameterType="String">
|
||||
DELETE FROM tb_wisdom_panel where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
112
ics-admin/src/main/resources/mapper/admin/WisdomRoomMapper.xml
Normal file
112
ics-admin/src/main/resources/mapper/admin/WisdomRoomMapper.xml
Normal file
@ -0,0 +1,112 @@
|
||||
<?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.WisdomRoomMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.WisdomRoom" id="WisdomRoomResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="meetingName" column="meeting_name" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="img" column="img" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="version" column="version" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="remake" column="remake" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWisdomRoomVo">
|
||||
SELECT id, type, meeting_name, start_time, end_date,img, create_by, create_time, update_by, update_time, version, delete_flag, remake, tenant_id, park_id FROM tb_wisdom_room
|
||||
</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,
|
||||
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>
|
||||
<if test="meetingName != null and meetingName != ''"> AND wr.meeting_name LIKE CONCAT('%', #{meetingName}, '%')</if>
|
||||
<if test="staffIds != null and staffIds != ''"> AND ws.staff_id LIKE CONCAT('%', #{staffIds}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWisdomRoomById" parameterType="Long" resultMap="WisdomRoomResult">
|
||||
<include refid="selectWisdomRoomVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWisdomRoom" parameterType="WisdomRoom" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_wisdom_room
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="meetingName != null and meetingName != ''">meeting_name,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="version != null ">version,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
<if test="img != null ">img,</if>
|
||||
<if test="remake != null and remake != ''">remake,</if>
|
||||
<if test="tenantId != null ">tenant_id,</if>
|
||||
<if test="parkId != null ">park_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="meetingName != null and meetingName != ''">#{meetingName},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="version != null ">#{version},</if>
|
||||
<if test="img != null ">#{img},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="remake != null and remake != ''">#{remake},</if>
|
||||
<if test="tenantId != null ">#{tenantId},</if>
|
||||
<if test="parkId != null ">#{parkId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWisdomRoom" parameterType="WisdomRoom">
|
||||
UPDATE tb_wisdom_room
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="meetingName != null and meetingName != ''">meeting_name = #{meetingName},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</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>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="version != null ">version = #{version},</if>
|
||||
<if test="img != null ">img = #{img},</if>
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
<if test="remake != null and remake != ''">remake = #{remake},</if>
|
||||
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
||||
<if test="parkId != null ">park_id = #{parkId},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWisdomRoomById" parameterType="Long">
|
||||
DELETE FROM tb_wisdom_room WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWisdomRoomByIds" parameterType="String">
|
||||
DELETE FROM tb_wisdom_room where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,90 @@
|
||||
<?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.WisdomStaffMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.WisdomStaff" id="WisdomStaffResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="wisdomRoomId" column="wisdom_room_id" />
|
||||
<result property="staffId" column="staff_id" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<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
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomStaffList" parameterType="WisdomStaff" resultMap="WisdomStaffResult">
|
||||
<include refid="selectWisdomStaffVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWisdomStaffById" parameterType="Long" resultMap="WisdomStaffResult">
|
||||
<include refid="selectWisdomStaffVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWisdomStaff" parameterType="WisdomStaff">
|
||||
INSERT INTO tb_wisdom_staff
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
<if test="wisdomRoomId != null ">wisdom_room_id,</if>
|
||||
<if test="staffId != null ">staff_id,</if>
|
||||
<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="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="tenantId != null ">tenant_id,</if>
|
||||
<if test="parkId != null ">park_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="wisdomRoomId != null ">#{wisdomRoomId},</if>
|
||||
<if test="staffId != null ">#{staffId},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="tenantId != null ">#{tenantId},</if>
|
||||
<if test="parkId != null ">#{parkId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWisdomStaff" parameterType="WisdomStaff">
|
||||
UPDATE tb_wisdom_staff
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="wisdomRoomId != null ">wisdom_room_id = #{wisdomRoomId},</if>
|
||||
<if test="staffId != null ">staff_id = #{staffId},</if>
|
||||
<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="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
||||
<if test="parkId != null ">park_id = #{parkId},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWisdomStaffById" parameterType="Long">
|
||||
DELETE FROM tb_wisdom_staff WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWisdomStaffByIds" parameterType="String">
|
||||
DELETE FROM tb_wisdom_staff where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -32,6 +32,17 @@
|
||||
<artifactId>tea-openapi</artifactId>
|
||||
<version>0.0.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hynnet</groupId>
|
||||
<artifactId>jacob</artifactId>
|
||||
<version>1.18</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.java-websocket</groupId>
|
||||
<artifactId>Java-WebSocket</artifactId>
|
||||
<version>1.5.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>tea-console</artifactId>
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.ics.common.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class WsClientConfig
|
||||
{
|
||||
// 配置WebSocket客户端
|
||||
//
|
||||
//
|
||||
@Bean
|
||||
public WebSocketClient webSocketClient(){
|
||||
WebSocketClient wsc = null;
|
||||
try {
|
||||
wsc = new WebSocketClient(new URI("ws://localhost:8081/websocket-server")) {
|
||||
@Override
|
||||
public void onOpen(ServerHandshake serverHandshake) {
|
||||
log.info("与服务端建立连接");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String s) {
|
||||
log.info("收到服务端的消息:{}", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int i, String s, boolean b) {
|
||||
log.info("与服务端的连接断开 code:{} reason:{} {}", i, s, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
log.info("连接报错");
|
||||
}
|
||||
};
|
||||
wsc.connect();
|
||||
return wsc;
|
||||
}catch (URISyntaxException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return wsc;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ics.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class WsServerConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
|
||||
return new ServerEndpointExporter();
|
||||
|
||||
}
|
||||
}
|
@ -121,8 +121,8 @@ public class BaseController {
|
||||
Token token = SubjectUtil.getToken(getRequest());
|
||||
String value = valueOperations.get(ACCESS_USERID + ":" + token.getUserId());
|
||||
JSONObject jo = StringUtils.isEmpty(value) ? null : JSON.parseObject(value, JSONObject.class);
|
||||
if (jo != null && jo.containsKey("staffId")) {
|
||||
return (Integer)jo.get("staffId");
|
||||
if (jo != null && jo.containsKey("userId")) {
|
||||
return (Integer)jo.get("userId");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class Sample {
|
||||
SendSmsRequest sendReq = new SendSmsRequest()
|
||||
.setPhoneNumbers(phone)
|
||||
.setSignName("长阳智会云控")
|
||||
.setTemplateCode("SMS_471775217")
|
||||
.setTemplateCode("SMS_472080045")
|
||||
.setTemplateParam
|
||||
(json.toJSONString());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
@ -74,7 +74,7 @@ public class Sample {
|
||||
SendSmsRequest sendReq = new SendSmsRequest()
|
||||
.setPhoneNumbers(phone)
|
||||
.setSignName("长阳智会云控")
|
||||
.setTemplateCode("SMS_471945046")
|
||||
.setTemplateCode("SMS_471965076")
|
||||
.setTemplateParam
|
||||
(json.toJSONString());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
@ -113,7 +113,7 @@ public class Sample {
|
||||
SendSmsRequest sendReq = new SendSmsRequest()
|
||||
.setPhoneNumbers(phone)
|
||||
.setSignName("长阳智会云控")
|
||||
.setTemplateCode("SMS_472025018")
|
||||
.setTemplateCode("SMS_472065044")
|
||||
.setTemplateParam
|
||||
(json.toJSONString());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.ics.common.utils.device;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class SignUtils {
|
||||
|
||||
/**
|
||||
* MD5加密
|
||||
*
|
||||
* @param strData
|
||||
* @return 返回加密字符
|
||||
*/
|
||||
public static String getMD5(String strData) {
|
||||
return DigestUtils.md5DigestAsHex(strData.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*
|
||||
* @param appID appID
|
||||
* @param key key
|
||||
* @param time 时间戳
|
||||
* @return 返回签名
|
||||
*/
|
||||
public static String sign(String appID, String key, Long time) {
|
||||
String sign1 = getMD5(time + "|" + key);
|
||||
return getMD5(sign1 + "|" + appID + "|" + key);
|
||||
}
|
||||
|
||||
public static void lock(String lockId){
|
||||
String appID = "90000021";
|
||||
String key = "cootoo";
|
||||
Long time = System.currentTimeMillis();
|
||||
|
||||
//http://111.23.208.229:8088/cootoo/openLock
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("appID",appID);
|
||||
on.put("requestID",time);
|
||||
on.put("peopleID","20249002");
|
||||
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();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,309 @@
|
||||
package com.ics.common.utils.device;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class WisDomDeviceUtils {
|
||||
|
||||
private static final String appId = "10001415";
|
||||
private static final String appKey = "af08e3de-1670-4f80-9844-152cc7bb5e8b";
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备唯一标识
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getDeviceId() {
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
jsonObject.put("pageNo",0);
|
||||
jsonObject.put("pageSize",10);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/developer/ccus")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
JSONArray data = jsonObject1.getJSONArray("data");
|
||||
|
||||
System.out.println(data.getJSONObject(0).getString("deviceId"));
|
||||
System.out.println(data.getJSONObject(0).getString("id"));
|
||||
System.out.println(data.getJSONObject(0).getString("productId"));
|
||||
|
||||
return "123456";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static JSONObject getDeviceStatus(String deviceId,String type){
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("id",deviceId);
|
||||
on.put("type",type);
|
||||
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/1.0/app/ccu/ef85e561-512d-4e9c-befe-ee4b0d9c2414/deviceStatus")
|
||||
.headerMap(heads, false)
|
||||
.body(on.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
JSONObject o = (JSONObject) jsonObject1.get("status");
|
||||
JSONObject jsonObject = JSON.parseObject(String.valueOf(o));
|
||||
|
||||
System.out.println(jsonObject);
|
||||
return jsonObject;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// JSONObject jsonObject = getDeviceStatus(210, "KONKE_ZIGBEE_CHOPIN_CURTAIN_CUSTOM");
|
||||
// System.out.println(jsonObject);
|
||||
openCover("4ab376ffdef1f8e0e7b346ead9ab648b","open_cover");
|
||||
// openCover("edd8a7b5390b7fa6359d5b411f82a936","close_cover");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备通用操作 (开关等控制器)
|
||||
*/
|
||||
public static Boolean deviceControl(String deviceId,boolean isOn){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("on",isOn);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_CHOPIN_LIGHT_PROJECT&action=SwitchOpt")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
log.info("灯控接口返回结果:{}",jsonObject1);
|
||||
log.info(DateUtil.date()+" -------灯控接口结果:{}",success);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*调光灯接口
|
||||
*/
|
||||
public static Boolean dimmingControl(String deviceId,int bri,int colourTemperature){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("bri",bri);
|
||||
on.put("colour_temperature",colourTemperature);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_Z3S_GALAXY_DIMMER_LIGHT&action=SetDimmableLightMode")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
log.info("调光灯接口返回结果:{}",jsonObject1);
|
||||
|
||||
log.info(DateUtil.date()+" -------调光灯接口结果:{}",success);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
//调光灯,亮度调节
|
||||
// public static Boolean dimmingLightControl(String deviceId,String mode,boolean on){
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
//
|
||||
// JSONObject on1 =new JSONObject();
|
||||
// on1.put("mode",mode);
|
||||
// on1.put("on",on);
|
||||
// jsonObject.put("actionArg",on1);
|
||||
// Map<String, String > heads = new HashMap<>();
|
||||
// heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
// heads.put("appId",appId);
|
||||
// heads.put("appKey",appKey );
|
||||
//
|
||||
// String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_Z3S_GALAXY_DIMMER_LIGHT&action=SetKLightMode")
|
||||
// .headerMap(heads, false)
|
||||
// .body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
//
|
||||
// JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
// Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
// return success;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 情景面板接口
|
||||
*/
|
||||
public static Boolean shortControl(String deviceId,int buttonId){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("buttonId",buttonId);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap <>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_CHOPIN_SHORTCUTPANEL_PROJECT&action=ActiveShortcutPanel")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
log.info("情景面板接口返回结果:{}",jsonObject1);
|
||||
|
||||
log.info(DateUtil.date()+" -------情景面板接口结果:{}",success);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 窗帘接口
|
||||
*/
|
||||
public static Boolean curtainControl(String deviceId,String opt){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("opt",opt);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_CHOPIN_CURTAIN_CUSTOM&action=MotorOpt")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
log.info("窗帘控制接口返回结果:{}",jsonObject1);
|
||||
|
||||
log.info(DateUtil.date()+" -------调用窗帘控制结果:{}",success);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插座接口
|
||||
* @param deviceId
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
public static Boolean socketControl(String deviceId, Boolean status) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("on",status);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_CHOPIN_10A_SOCKET&action=SwitchOpt")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
|
||||
log.info("插座接口返回结果:{}",jsonObject1);
|
||||
log.info(DateUtil.date()+" -------插座接口结果:{}",success);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static Boolean dimmingOpenControl(String deviceId, Boolean status) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("on",status);
|
||||
jsonObject.put("actionArg",on);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
heads.put("appId",appId);
|
||||
heads.put("appKey",appKey );
|
||||
|
||||
String result = HttpRequest.post("https://iot.ikonke.com:4432/2.0/ccu/CCU_288340/device/"+deviceId+"/opt?realType=KONKE_ZIGBEE_Z3S_GALAXY_DIMMER_LIGHT&action=SwitchOpt")
|
||||
.headerMap(heads, false)
|
||||
.body(jsonObject.toString()).timeout(30*1000).execute().body();
|
||||
|
||||
JSONObject jsonObject1 = JSON.parseObject(result);
|
||||
Boolean success = Boolean.valueOf(jsonObject1.getString("success"));
|
||||
|
||||
log.info("调光灯接口返回结果:{}",jsonObject1);
|
||||
log.info(DateUtil.date()+" -------调光灯接口结果:{}",success);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 卷帘开启
|
||||
*/
|
||||
public static Boolean openCover(String deviceId, String status) {
|
||||
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("device_id",deviceId);
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
heads.put("Authorization","Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI1ZTg3OGUyMmQ3NDc0ZTM4YTFhMmY5ODQzZDcxM2FhOCIsImlhdCI6MTcyMjYwMjU1NCwiZXhwIjoyMDM3OTYyNTU0fQ.Wjo9F0FSbFiVySwFzyHmKwt5ncneis-oPO6sPSffUJg");
|
||||
heads.put("Content-Type", "application/json;charset=UTF-8");
|
||||
HttpRequest.post("http://222.184.49.22:8123/api/services/cover/"+status)
|
||||
.headerMap(heads,false)
|
||||
.body(on.toString()).timeout(30*1000).executeAsync();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -8,12 +8,14 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
import org.wf.jwtp.configuration.EnableJwtPermission;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
*/
|
||||
@EnableWebSocket
|
||||
@EnableJwtPermission
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class ApplicationRun {
|
||||
|
@ -221,6 +221,9 @@ public class ApiRoomContentController extends BaseController {
|
||||
boolean save = reservationService.save(reservation);
|
||||
Assert.isTrue(save, "预约失败");
|
||||
|
||||
// 预约成功后,获取门锁
|
||||
|
||||
|
||||
//新增预约服务数据
|
||||
|
||||
List<String> serveNames = new ArrayList<>();
|
||||
|
@ -0,0 +1,158 @@
|
||||
package com.ics.controller.mobile.wisdom;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.domain.*;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/wisdom")
|
||||
public class WisdomApiController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IWisdomRoomService wisdomRoomService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomDeviceService wisdomDeviceService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomStaffService wisdomStaffService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomPanelService wisdomPanelService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomPanelEquipmentService wisdomPanelEquipmentService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有房间信息
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@RequestMapping("/getAllRoomInfo")
|
||||
public R getAllRoomInfo(WisdomRoom wisdomRoom) {
|
||||
|
||||
long currentUserId = getLoginStaffId();
|
||||
wisdomRoom.setStaffIds(currentUserId);
|
||||
|
||||
List<WisdomRoom> wisdomRooms = wisdomRoomService.selectWisdomRoomList(wisdomRoom);
|
||||
for (WisdomRoom room : wisdomRooms) {
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
wisdomDevice.setWisdomRoomId(room.getId());
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
room.setDeviceNum(wisdomDevices.size());
|
||||
WisdomPanel wisdomPanel = new WisdomPanel();
|
||||
wisdomPanel.setWisdomRoom(room.getId());
|
||||
List<WisdomPanel> wisdomPanels = wisdomPanelService.selectWisdomPanelList(wisdomPanel);
|
||||
room.setPanelNum(wisdomPanels.size());
|
||||
}
|
||||
return R.data(wisdomRooms);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据房间获取对应设备列表
|
||||
*/
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据房间获取对应情景列表
|
||||
*/
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/getAllPanelInfoByRoomId")
|
||||
public R getAllPanelInfoByRoomId(Long id ) {
|
||||
WisdomPanel wisdomPanel = new WisdomPanel();
|
||||
wisdomPanel.setWisdomRoom(id);
|
||||
List<WisdomPanel> wisdomPanels = wisdomPanelService.selectWisdomPanelList(wisdomPanel);
|
||||
return R.data(wisdomPanels);
|
||||
}
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("getDeviceInfo")
|
||||
public R getDeviceInfo(Long id) {
|
||||
WisdomDevice wisdomDevice = wisdomDeviceService.selectWisdomDeviceById(id);
|
||||
if (wisdomDevice == null) return R.error("设备不存在");
|
||||
|
||||
|
||||
JSONObject deviceStatus = WisDomDeviceUtils.getDeviceStatus(wisdomDevice.getEquipmentNum(), wisdomDevice.getTypeName());
|
||||
|
||||
return R.ok(deviceStatus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据设备id调用对接接口
|
||||
*/
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@RequestMapping("/callApiByDeviceId")
|
||||
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("调光灯")){
|
||||
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());
|
||||
|
||||
//todo 窗帘接口
|
||||
if (wisdomDevice.getType().equals("窗帘")) WisDomDeviceUtils.openCover(wisdomDevice.getEquipmentNum(), deviceVo.getCoverType());
|
||||
if (wisdomDevice.getType().equals("门锁")) SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据情景面板id 调用对接
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@RequestMapping("/callApiByPanelId")
|
||||
public R callApiByPanelId(@RequestBody WisdomPanel panelVo) {
|
||||
WisdomPanel wisdomPanel = wisdomPanelService.selectWisdomPanelById(panelVo.getId());
|
||||
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());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
}
|
214
ics-web/src/main/java/com/ics/server/WsServer.java
Normal file
214
ics-web/src/main/java/com/ics/server/WsServer.java
Normal file
@ -0,0 +1,214 @@
|
||||
package com.ics.server;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.boyue.changyangoffice.domain.DeviceInfo;
|
||||
//import com.boyue.changyangoffice.domain.R;
|
||||
//import com.boyue.changyangoffice.entity.Equipment;
|
||||
//import com.boyue.changyangoffice.entity.Panel;
|
||||
//import com.boyue.changyangoffice.entity.PanelEquipment;
|
||||
//import com.boyue.changyangoffice.service.IEquipmentService;
|
||||
//import com.boyue.changyangoffice.service.IPanelEquipmentService;
|
||||
//import com.boyue.changyangoffice.service.IPanelService;
|
||||
//import com.boyue.changyangoffice.utils.DeviceUtils;
|
||||
import com.ics.common.core.domain.R;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @ClassDescription: websocket服务端
|
||||
* @JdkVersion: 1.8
|
||||
* @Author: 李白
|
||||
* @Created: 2023/8/31 14:59
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RestController
|
||||
@ServerEndpoint(value = "/websocket-server")
|
||||
//@ServerEndpoint("/")
|
||||
public class WsServer {
|
||||
|
||||
|
||||
private Session session;
|
||||
|
||||
// @Autowired
|
||||
// private IPanelEquipmentService panelEquipmentService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IEquipmentService equipmentService;
|
||||
//
|
||||
// @Autowired
|
||||
// private IPanelService panelService;
|
||||
|
||||
|
||||
/**
|
||||
* 记录在线连接客户端数量
|
||||
*/
|
||||
private static AtomicInteger onlineCount = new AtomicInteger(0);
|
||||
/**
|
||||
* 存放每个连接进来的客户端对应的websocketServer对象,用于后面群发消息
|
||||
*/
|
||||
private static CopyOnWriteArrayList<WsServer> wsServers = new CopyOnWriteArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
* 服务端与客户端连接成功时执行
|
||||
*
|
||||
* @param session 会话
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session) {
|
||||
//将这次会话信息记录
|
||||
|
||||
this.session = session;
|
||||
|
||||
//接入的客户端+1
|
||||
int count = onlineCount.incrementAndGet();
|
||||
//集合中存入客户端对象+1
|
||||
wsServers.add(this);
|
||||
log.info("与客户端连接成功,当前连接的客户端数量为:{}", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到客户端的消息时执行
|
||||
*
|
||||
* @param message 消息
|
||||
* @param session 会话
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("收到来自客户端的消息,客户端地址:{},消息内容:{}", session.getMessageHandlers(), message);
|
||||
//业务逻辑,对消息的处理
|
||||
// sendMessageToAll("群发消息的内容");
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接发生报错时执行
|
||||
*
|
||||
* @param session 会话
|
||||
* @param throwable 报错
|
||||
*/
|
||||
@OnError
|
||||
public void onError(Session session, @NonNull Throwable throwable) {
|
||||
log.error("连接发生报错");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接断开时执行
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
//接入客户端连接数-1
|
||||
int count = onlineCount.decrementAndGet();
|
||||
//集合中的客户端对象-1
|
||||
wsServers.remove(this);
|
||||
log.info("服务端断开连接,当前连接的客户端数量为:{}", count);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向客户端推送消息
|
||||
*
|
||||
* @param message 消息
|
||||
*/
|
||||
public void sendMessage(String message) {
|
||||
|
||||
this.session.getAsyncRemote().sendText(message);
|
||||
log.info("推送消息给客户端:{},消息内容为:{}", this.session.getMessageHandlers(), message);
|
||||
}
|
||||
|
||||
// @PostMapping("/device/pushDeviceInfo")
|
||||
// public R pushDeviceInfo(@RequestBody DeviceInfo deviceInfo) throws IOException {
|
||||
//
|
||||
// if (null != deviceInfo) {
|
||||
// log.info("接收到的设备信息:{}", deviceInfo);
|
||||
// String beanToString = JSON.toJSONString(deviceInfo);
|
||||
// System.out.println("接收到的设备信息:" + beanToString);
|
||||
//
|
||||
//
|
||||
// sendMessageToAll(beanToString);
|
||||
//
|
||||
// //如果类型是 情景面板的
|
||||
// JSONObject jsonObject = JSONObject.parseObject(beanToString);
|
||||
// String pushMsgType = (String) jsonObject.get("pushMsgType");
|
||||
//
|
||||
// if (pushMsgType.equals("ShortcutPanelActivedEvent")) {
|
||||
// //如果类型是 情景面板的 去查询数据库的情景面板id 如果匹配,查询对应的窗帘 进行开关。
|
||||
// //获取 按钮id 和面板id
|
||||
// JSONObject pushMsg = (JSONObject) jsonObject.get("pushMsg");
|
||||
// Integer panelId = (Integer) pushMsg.get("id");
|
||||
// String buttonId = (String) pushMsg.get("buttonId");
|
||||
//
|
||||
// QueryWrapper<Panel> wrapper1 = new QueryWrapper<Panel>();
|
||||
// wrapper1.eq("panel_id", panelId);
|
||||
// wrapper1.eq("button_id", buttonId);
|
||||
//
|
||||
// Panel panel = panelService.getOne(wrapper1);
|
||||
// if (null != panel) {
|
||||
// //根据面板id获取对应的设备id
|
||||
// QueryWrapper<PanelEquipment> wrapper = new QueryWrapper<>();
|
||||
// wrapper.eq("panel_id", panel.getId());
|
||||
// List<PanelEquipment> list = panelEquipmentService.list(wrapper);
|
||||
// if (CollUtil.isNotEmpty(list)) {
|
||||
// //如果设备id不等于空
|
||||
// for (PanelEquipment panelEquipment : list) {
|
||||
// Equipment equipment = equipmentService.getById(panelEquipment.getEquipmentId());
|
||||
// if (null != equipment) {
|
||||
// Boolean aBoolean = DeviceUtils.openCover(equipment.getEquipmentNum(), panelEquipment.getType());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //控克 灯
|
||||
//
|
||||
//
|
||||
// return R.ok();
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 群发消息
|
||||
*
|
||||
* @param message 消息
|
||||
*/
|
||||
public void sendMessageToAll(String message) {
|
||||
CopyOnWriteArrayList<WsServer> ws = wsServers;
|
||||
for (WsServer wsServer : ws) {
|
||||
wsServer.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
// @PostMapping("/send2AllC")
|
||||
// public void sendMessageToAll1(@RequestBody String message){
|
||||
// CopyOnWriteArrayList<WsServer> ws = wsServers;
|
||||
// for (WsServer wsServer : ws){
|
||||
// wsServer.sendMessage(message);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user