8 changed files with 345 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||
package com.ruoyi.web.controller; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.system.domain.RoomPlatformIcon; |
|||
import com.ruoyi.system.service.IRoomPlatformIconService; |
|||
|
|||
/** |
|||
* 房间地图平台图标Controller |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/roomPlatformIcon") |
|||
public class RoomPlatformIconController extends BaseController { |
|||
|
|||
@Autowired |
|||
private IRoomPlatformIconService roomPlatformIconService; |
|||
|
|||
/** |
|||
* 按房间ID查询该房间下所有地图平台图标(不分页) |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:list')") |
|||
@GetMapping("/list") |
|||
public AjaxResult list(@RequestParam Long roomId) { |
|||
List<RoomPlatformIcon> list = roomPlatformIconService.selectListByRoomId(roomId); |
|||
return success(list); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:add')") |
|||
@Log(title = "房间地图平台图标", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody RoomPlatformIcon roomPlatformIcon) { |
|||
int rows = roomPlatformIconService.insert(roomPlatformIcon); |
|||
return rows > 0 ? success(roomPlatformIcon) : error("新增失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改(位置/朝向/缩放) |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:edit')") |
|||
@Log(title = "房间地图平台图标", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody RoomPlatformIcon roomPlatformIcon) { |
|||
return toAjax(roomPlatformIconService.update(roomPlatformIcon)); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:remove')") |
|||
@Log(title = "房间地图平台图标", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{id}") |
|||
public AjaxResult remove(@PathVariable Long id) { |
|||
return toAjax(roomPlatformIconService.deleteById(id)); |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 房间地图平台图标对象 room_platform_icon |
|||
*/ |
|||
public class RoomPlatformIcon extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Excel(name = "主键") |
|||
private Long id; |
|||
@Excel(name = "房间ID") |
|||
private Long roomId; |
|||
@Excel(name = "平台库ID") |
|||
private Long platformId; |
|||
@Excel(name = "平台名称快照") |
|||
private String platformName; |
|||
@Excel(name = "平台类型快照") |
|||
private String platformType; |
|||
@Excel(name = "图标URL快照") |
|||
private String iconUrl; |
|||
@Excel(name = "经度") |
|||
private Double lng; |
|||
@Excel(name = "纬度") |
|||
private Double lat; |
|||
@Excel(name = "朝向(度)") |
|||
private Double heading; |
|||
@Excel(name = "图标缩放") |
|||
private Double iconScale; |
|||
@Excel(name = "排序") |
|||
private Integer sortOrder; |
|||
|
|||
public void setId(Long id) { this.id = id; } |
|||
public Long getId() { return id; } |
|||
public void setRoomId(Long roomId) { this.roomId = roomId; } |
|||
public Long getRoomId() { return roomId; } |
|||
public void setPlatformId(Long platformId) { this.platformId = platformId; } |
|||
public Long getPlatformId() { return platformId; } |
|||
public void setPlatformName(String platformName) { this.platformName = platformName; } |
|||
public String getPlatformName() { return platformName; } |
|||
public void setPlatformType(String platformType) { this.platformType = platformType; } |
|||
public String getPlatformType() { return platformType; } |
|||
public void setIconUrl(String iconUrl) { this.iconUrl = iconUrl; } |
|||
public String getIconUrl() { return iconUrl; } |
|||
public void setLng(Double lng) { this.lng = lng; } |
|||
public Double getLng() { return lng; } |
|||
public void setLat(Double lat) { this.lat = lat; } |
|||
public Double getLat() { return lat; } |
|||
public void setHeading(Double heading) { this.heading = heading; } |
|||
public Double getHeading() { return heading; } |
|||
public void setIconScale(Double iconScale) { this.iconScale = iconScale; } |
|||
public Double getIconScale() { return iconScale; } |
|||
public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; } |
|||
public Integer getSortOrder() { return sortOrder; } |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.RoomPlatformIcon; |
|||
|
|||
/** |
|||
* 房间地图平台图标Mapper接口 |
|||
*/ |
|||
public interface RoomPlatformIconMapper { |
|||
|
|||
RoomPlatformIcon selectRoomPlatformIconById(Long id); |
|||
|
|||
List<RoomPlatformIcon> selectRoomPlatformIconList(RoomPlatformIcon roomPlatformIcon); |
|||
|
|||
int insertRoomPlatformIcon(RoomPlatformIcon roomPlatformIcon); |
|||
|
|||
int updateRoomPlatformIcon(RoomPlatformIcon roomPlatformIcon); |
|||
|
|||
int deleteRoomPlatformIconById(Long id); |
|||
|
|||
int deleteRoomPlatformIconByRoomId(Long roomId); |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.RoomPlatformIcon; |
|||
|
|||
/** |
|||
* 房间地图平台图标Service接口 |
|||
*/ |
|||
public interface IRoomPlatformIconService { |
|||
|
|||
List<RoomPlatformIcon> selectListByRoomId(Long roomId); |
|||
|
|||
RoomPlatformIcon selectById(Long id); |
|||
|
|||
int insert(RoomPlatformIcon roomPlatformIcon); |
|||
|
|||
int update(RoomPlatformIcon roomPlatformIcon); |
|||
|
|||
int deleteById(Long id); |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.system.mapper.RoomPlatformIconMapper; |
|||
import com.ruoyi.system.domain.RoomPlatformIcon; |
|||
import com.ruoyi.system.service.IRoomPlatformIconService; |
|||
|
|||
/** |
|||
* 房间地图平台图标Service业务层 |
|||
*/ |
|||
@Service |
|||
public class RoomPlatformIconServiceImpl implements IRoomPlatformIconService { |
|||
|
|||
@Autowired |
|||
private RoomPlatformIconMapper roomPlatformIconMapper; |
|||
|
|||
@Override |
|||
public List<RoomPlatformIcon> selectListByRoomId(Long roomId) { |
|||
RoomPlatformIcon query = new RoomPlatformIcon(); |
|||
query.setRoomId(roomId); |
|||
return roomPlatformIconMapper.selectRoomPlatformIconList(query); |
|||
} |
|||
|
|||
@Override |
|||
public RoomPlatformIcon selectById(Long id) { |
|||
return roomPlatformIconMapper.selectRoomPlatformIconById(id); |
|||
} |
|||
|
|||
@Override |
|||
public int insert(RoomPlatformIcon roomPlatformIcon) { |
|||
Date now = new Date(); |
|||
roomPlatformIcon.setCreateTime(now); |
|||
roomPlatformIcon.setUpdateTime(now); |
|||
return roomPlatformIconMapper.insertRoomPlatformIcon(roomPlatformIcon); |
|||
} |
|||
|
|||
@Override |
|||
public int update(RoomPlatformIcon roomPlatformIcon) { |
|||
roomPlatformIcon.setUpdateTime(new Date()); |
|||
return roomPlatformIconMapper.updateRoomPlatformIcon(roomPlatformIcon); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteById(Long id) { |
|||
return roomPlatformIconMapper.deleteRoomPlatformIconById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
<?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.ruoyi.system.mapper.RoomPlatformIconMapper"> |
|||
|
|||
<resultMap type="com.ruoyi.system.domain.RoomPlatformIcon" id="RoomPlatformIconResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="roomId" column="room_id" /> |
|||
<result property="platformId" column="platform_id" /> |
|||
<result property="platformName" column="platform_name"/> |
|||
<result property="platformType" column="platform_type"/> |
|||
<result property="iconUrl" column="icon_url" /> |
|||
<result property="lng" column="lng" /> |
|||
<result property="lat" column="lat" /> |
|||
<result property="heading" column="heading" /> |
|||
<result property="iconScale" column="icon_scale" /> |
|||
<result property="sortOrder" column="sort_order" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectRoomPlatformIconVo"> |
|||
select id, room_id, platform_id, platform_name, platform_type, icon_url, |
|||
lng, lat, heading, icon_scale, sort_order, create_time, update_time |
|||
from room_platform_icon |
|||
</sql> |
|||
|
|||
<select id="selectRoomPlatformIconList" resultMap="RoomPlatformIconResult"> |
|||
<include refid="selectRoomPlatformIconVo"/> |
|||
<where> |
|||
<if test="roomId != null"> and room_id = #{roomId}</if> |
|||
<if test="platformId != null"> and platform_id = #{platformId}</if> |
|||
</where> |
|||
order by sort_order asc, id asc |
|||
</select> |
|||
|
|||
<select id="selectRoomPlatformIconById" resultMap="RoomPlatformIconResult"> |
|||
<include refid="selectRoomPlatformIconVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertRoomPlatformIcon" parameterType="com.ruoyi.system.domain.RoomPlatformIcon" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into room_platform_icon |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="roomId != null">room_id,</if> |
|||
<if test="platformId != null">platform_id,</if> |
|||
<if test="platformName != null">platform_name,</if> |
|||
<if test="platformType != null">platform_type,</if> |
|||
<if test="iconUrl != null">icon_url,</if> |
|||
<if test="lng != null">lng,</if> |
|||
<if test="lat != null">lat,</if> |
|||
<if test="heading != null">heading,</if> |
|||
<if test="iconScale != null">icon_scale,</if> |
|||
<if test="sortOrder != null">sort_order,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="roomId != null">#{roomId},</if> |
|||
<if test="platformId != null">#{platformId},</if> |
|||
<if test="platformName != null">#{platformName},</if> |
|||
<if test="platformType != null">#{platformType},</if> |
|||
<if test="iconUrl != null">#{iconUrl},</if> |
|||
<if test="lng != null">#{lng},</if> |
|||
<if test="lat != null">#{lat},</if> |
|||
<if test="heading != null">#{heading},</if> |
|||
<if test="iconScale != null">#{iconScale},</if> |
|||
<if test="sortOrder != null">#{sortOrder},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateRoomPlatformIcon" parameterType="com.ruoyi.system.domain.RoomPlatformIcon"> |
|||
update room_platform_icon |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="lng != null">lng = #{lng},</if> |
|||
<if test="lat != null">lat = #{lat},</if> |
|||
<if test="heading != null">heading = #{heading},</if> |
|||
<if test="iconScale != null">icon_scale = #{iconScale},</if> |
|||
<if test="sortOrder != null">sort_order = #{sortOrder},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteRoomPlatformIconById" parameterType="Long"> |
|||
delete from room_platform_icon where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteRoomPlatformIconByRoomId" parameterType="Long"> |
|||
delete from room_platform_icon where room_id = #{roomId} |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,36 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
/** 按房间ID查询该房间下所有地图平台图标 */ |
|||
export function listByRoomId(roomId) { |
|||
return request({ |
|||
url: '/system/roomPlatformIcon/list', |
|||
method: 'get', |
|||
params: { roomId } |
|||
}) |
|||
} |
|||
|
|||
/** 新增房间地图平台图标 */ |
|||
export function addRoomPlatformIcon(data) { |
|||
return request({ |
|||
url: '/system/roomPlatformIcon', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
/** 修改房间地图平台图标(位置/朝向/缩放) */ |
|||
export function updateRoomPlatformIcon(data) { |
|||
return request({ |
|||
url: '/system/roomPlatformIcon', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
/** 删除房间地图平台图标 */ |
|||
export function delRoomPlatformIcon(id) { |
|||
return request({ |
|||
url: '/system/roomPlatformIcon/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
After Width: | Height: | Size: 1001 B |
Loading…
Reference in new issue