若依微服务1.4.0
1、设备管理增加重启,并且只有网关和直连设备可以控制 2、数据处理完善对图片的处理 3、增加手机端的接口 4、tenantId写到header中,以便在保存数据时获取 5、角色管理租户可增删改查dev 1.4.1
parent
5d20ff6f48
commit
53d37173a4
@ -0,0 +1,123 @@
|
||||
package com.ruoyi.basic.controller;
|
||||
|
||||
|
||||
import com.ruoyi.basic.api.domain.HwTenant;
|
||||
import com.ruoyi.basic.service.IHwTenantService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.api.domain.SysUser;
|
||||
import com.ruoyi.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租户信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tenant")
|
||||
public class HwTenantController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwTenantService hwTenantService;
|
||||
|
||||
/**
|
||||
* 分页查询租户信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwTenant hwTenant)
|
||||
{
|
||||
List<HwTenant> list = new ArrayList<HwTenant>();
|
||||
startPage();
|
||||
//todo 放到add中
|
||||
|
||||
list = hwTenantService.selectHwTenantList(hwTenant);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:export")
|
||||
@Log(title = "租户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwTenant hwTenant)
|
||||
{
|
||||
List<HwTenant> list = hwTenantService.selectHwTenantList(hwTenant);
|
||||
ExcelUtil<HwTenant> util = new ExcelUtil<HwTenant>(HwTenant.class);
|
||||
util.exportExcel(response, list, "租户信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:query")
|
||||
@GetMapping(value = "/{tenantId}")
|
||||
public AjaxResult getInfo(@PathVariable("tenantId") Long tenantId)
|
||||
{
|
||||
return success(hwTenantService.selectHwTenantByTenantId(tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户信息
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:add")
|
||||
@Log(title = "租户信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwTenant hwTenant)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
hwTenant.setIsRegister("0");
|
||||
hwTenant.setCreateBy(sysUser.getNickName());
|
||||
return toAjax(hwTenantService.insertHwTenant(hwTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户信息
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:edit")
|
||||
@Log(title = "租户信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwTenant hwTenant)
|
||||
{LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
|
||||
hwTenant.setUpdateBy(sysUser.getNickName());
|
||||
return toAjax(hwTenantService.updateHwTenant(hwTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户信息
|
||||
*/
|
||||
@RequiresPermissions("business:tenant:remove")
|
||||
@Log(title = "租户信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tenantIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] tenantIds)
|
||||
{
|
||||
return toAjax(hwTenantService.deleteHwTenantByTenantIds(tenantIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户信息列表
|
||||
*/
|
||||
@GetMapping("/getTenants")
|
||||
public R<List<HwTenant>> getTenants(HwTenant hwTenant)
|
||||
{
|
||||
return R.ok(hwTenantService.selectHwTenantList(hwTenant));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwFenceArea;
|
||||
|
||||
/**
|
||||
* 电子围栏区域Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-19
|
||||
*/
|
||||
public interface HwFenceAreaMapper
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏区域
|
||||
*
|
||||
* @param fenceAreaId 电子围栏区域主键
|
||||
* @return 电子围栏区域
|
||||
*/
|
||||
public HwFenceArea selectHwFenceAreaByFenceAreaId(Long fenceAreaId);
|
||||
|
||||
/**
|
||||
* 查询电子围栏区域列表
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 电子围栏区域集合
|
||||
*/
|
||||
public List<HwFenceArea> selectHwFenceAreaList(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 新增电子围栏区域
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwFenceArea(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 修改电子围栏区域
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwFenceArea(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 删除电子围栏区域
|
||||
*
|
||||
* @param fenceAreaId 电子围栏区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwFenceAreaByFenceAreaId(Long fenceAreaId);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏区域
|
||||
*
|
||||
* @param fenceAreaIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwFenceAreaByFenceAreaIds(Long[] fenceAreaIds);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
|
||||
public interface IHwCommonService {
|
||||
|
||||
public void createTdTable(HwDevice hwDevice);
|
||||
|
||||
public void updateMqttAut(HwDevice hwDevice);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
<?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.business.mapper.HwFenceAreaMapper">
|
||||
|
||||
<resultMap type="HwFenceArea" id="HwFenceAreaResult">
|
||||
<result property="fenceAreaId" column="fence_area_id" />
|
||||
<result property="electronicFenceId" column="electronic_fence_id" />
|
||||
<result property="areaShapeFlag" column="area_shape_flag" />
|
||||
<result property="areaRange" column="area_range" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwFenceAreaVo">
|
||||
select fence_area_id, electronic_fence_id, area_shape_flag, area_range from hw_fence_area
|
||||
</sql>
|
||||
|
||||
<select id="selectHwFenceAreaList" parameterType="HwFenceArea" resultMap="HwFenceAreaResult">
|
||||
<include refid="selectHwFenceAreaVo"/>
|
||||
<where>
|
||||
<if test="electronicFenceId != null "> and electronic_fence_id = #{electronicFenceId}</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''"> and area_shape_flag = #{areaShapeFlag}</if>
|
||||
<if test="areaRange != null and areaRange != ''"> and area_range = #{areaRange}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwFenceAreaByFenceAreaId" parameterType="Long" resultMap="HwFenceAreaResult">
|
||||
<include refid="selectHwFenceAreaVo"/>
|
||||
where fence_area_id = #{fenceAreaId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwFenceArea" parameterType="HwFenceArea" useGeneratedKeys="true" keyProperty="fenceAreaId">
|
||||
insert into hw_fence_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">electronic_fence_id,</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">area_shape_flag,</if>
|
||||
<if test="areaRange != null">area_range,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">#{electronicFenceId},</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">#{areaShapeFlag},</if>
|
||||
<if test="areaRange != null">#{areaRange},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwFenceArea" parameterType="HwFenceArea">
|
||||
update hw_fence_area
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">electronic_fence_id = #{electronicFenceId},</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">area_shape_flag = #{areaShapeFlag},</if>
|
||||
<if test="areaRange != null">area_range = #{areaRange},</if>
|
||||
</trim>
|
||||
where fence_area_id = #{fenceAreaId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwFenceAreaByFenceAreaId" parameterType="Long">
|
||||
delete from hw_fence_area where fence_area_id = #{fenceAreaId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwFenceAreaByFenceAreaIds" parameterType="String">
|
||||
delete from hw_fence_area where fence_area_id in
|
||||
<foreach item="fenceAreaId" collection="array" open="(" separator="," close=")">
|
||||
#{fenceAreaId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue