修改安防设备管理模块逻辑
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
parent
aa5b0b9478
commit
adafd52d0f
@ -10,10 +10,19 @@ public class TreeNode<T> implements TreeEntity<TreeNode<T>, T> {
|
|||||||
private Integer level;
|
private Integer level;
|
||||||
// 编码
|
// 编码
|
||||||
private T code;
|
private T code;
|
||||||
|
private T key;
|
||||||
// 父编码
|
// 父编码
|
||||||
private T ParentCode;
|
private T ParentCode;
|
||||||
// 标签
|
// 标签
|
||||||
private String label;
|
private String label;
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存放阶段数据
|
||||||
|
*/
|
||||||
|
private Object data;
|
||||||
|
|
||||||
// 子节点
|
// 子节点
|
||||||
private List<TreeNode<T>> children;
|
private List<TreeNode<T>> children;
|
||||||
|
|
||||||
|
@ -1,247 +0,0 @@
|
|||||||
<?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=".mapper.CostPayFeeAuditMapper">
|
|
||||||
|
|
||||||
<resultMap type=".domain.CostPayFeeAudit" id="CostPayFeeAuditMap">
|
|
||||||
<result property="id" column="id"/>
|
|
||||||
<result property="houseChargeId" column="house_charge_id"/>
|
|
||||||
<result property="itemId" column="item_id"/>
|
|
||||||
<result property="startTime" column="start_time"/>
|
|
||||||
<result property="endTime" column="end_time"/>
|
|
||||||
<result property="receivedAmount" column="received_amount"/>
|
|
||||||
<result property="receivableAmount" column="receivable_amount"/>
|
|
||||||
<result property="payTime" column="pay_time"/>
|
|
||||||
<result property="state" column="state"/>
|
|
||||||
<result property="remark" column="remark"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="createBy" column="create_by"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
<result property="updateBy" column="update_by"/>
|
|
||||||
<result property="searchValue" column="search_value"/>
|
|
||||||
<result property="createDept" column="create_dept"/>
|
|
||||||
<result property="tenantId" column="tenant_id"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<!--查询所有-->
|
|
||||||
<select id="queryAll" resultMap="CostPayFeeAuditMap">
|
|
||||||
select
|
|
||||||
id, house_charge_id, item_id, start_time, end_time, received_amount, receivable_amount, pay_time, state, remark, create_time, create_by, update_time, update_by, search_value, create_dept, tenant_id
|
|
||||||
from cost_pay_fee_audit
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--查询单个-->
|
|
||||||
<select id="queryById" resultMap="CostPayFeeAuditMap">
|
|
||||||
select
|
|
||||||
id, house_charge_id, item_id, start_time, end_time, received_amount, receivable_amount, pay_time, state, remark, create_time, create_by, update_time, update_by, search_value, create_dept, tenant_id
|
|
||||||
from cost_pay_fee_audit
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--查询指定行数据-->
|
|
||||||
<select id="queryAllByLimit" resultMap="CostPayFeeAuditMap">
|
|
||||||
select
|
|
||||||
id, house_charge_id, item_id, start_time, end_time, received_amount, receivable_amount, pay_time, state, remark, create_time, create_by, update_time, update_by, search_value, create_dept, tenant_id
|
|
||||||
from cost_pay_fee_audit
|
|
||||||
<where>
|
|
||||||
<if test="id != null">
|
|
||||||
and id = #{id}
|
|
||||||
</if>
|
|
||||||
<if test="houseChargeId != null">
|
|
||||||
and house_charge_id = #{houseChargeId}
|
|
||||||
</if>
|
|
||||||
<if test="itemId != null">
|
|
||||||
and item_id = #{itemId}
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
and start_time = #{startTime}
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
and end_time = #{endTime}
|
|
||||||
</if>
|
|
||||||
<if test="receivedAmount != null">
|
|
||||||
and received_amount = #{receivedAmount}
|
|
||||||
</if>
|
|
||||||
<if test="receivableAmount != null">
|
|
||||||
and receivable_amount = #{receivableAmount}
|
|
||||||
</if>
|
|
||||||
<if test="payTime != null">
|
|
||||||
and pay_time = #{payTime}
|
|
||||||
</if>
|
|
||||||
<if test="state != null and state != ''">
|
|
||||||
and state = #{state}
|
|
||||||
</if>
|
|
||||||
<if test="remark != null and remark != ''">
|
|
||||||
and remark = #{remark}
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
and create_time = #{createTime}
|
|
||||||
</if>
|
|
||||||
<if test="createBy != null and createBy != ''">
|
|
||||||
and create_by = #{createBy}
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
and update_time = #{updateTime}
|
|
||||||
</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">
|
|
||||||
and update_by = #{updateBy}
|
|
||||||
</if>
|
|
||||||
<if test="searchValue != null and searchValue != ''">
|
|
||||||
and search_value = #{searchValue}
|
|
||||||
</if>
|
|
||||||
<if test="createDept != null">
|
|
||||||
and create_dept = #{createDept}
|
|
||||||
</if>
|
|
||||||
<if test="tenantId != null and tenantId != ''">
|
|
||||||
and tenant_id = #{tenantId}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
limit #{pageable.offset}, #{pageable.pageSize}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--统计总行数-->
|
|
||||||
<select id="count" resultType="java.lang.Long">
|
|
||||||
select count(1)
|
|
||||||
from cost_pay_fee_audit
|
|
||||||
<where>
|
|
||||||
<if test="id != null">
|
|
||||||
and id = #{id}
|
|
||||||
</if>
|
|
||||||
<if test="houseChargeId != null">
|
|
||||||
and house_charge_id = #{houseChargeId}
|
|
||||||
</if>
|
|
||||||
<if test="itemId != null">
|
|
||||||
and item_id = #{itemId}
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
and start_time = #{startTime}
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
and end_time = #{endTime}
|
|
||||||
</if>
|
|
||||||
<if test="receivedAmount != null">
|
|
||||||
and received_amount = #{receivedAmount}
|
|
||||||
</if>
|
|
||||||
<if test="receivableAmount != null">
|
|
||||||
and receivable_amount = #{receivableAmount}
|
|
||||||
</if>
|
|
||||||
<if test="payTime != null">
|
|
||||||
and pay_time = #{payTime}
|
|
||||||
</if>
|
|
||||||
<if test="state != null and state != ''">
|
|
||||||
and state = #{state}
|
|
||||||
</if>
|
|
||||||
<if test="remark != null and remark != ''">
|
|
||||||
and remark = #{remark}
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
and create_time = #{createTime}
|
|
||||||
</if>
|
|
||||||
<if test="createBy != null and createBy != ''">
|
|
||||||
and create_by = #{createBy}
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
and update_time = #{updateTime}
|
|
||||||
</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">
|
|
||||||
and update_by = #{updateBy}
|
|
||||||
</if>
|
|
||||||
<if test="searchValue != null and searchValue != ''">
|
|
||||||
and search_value = #{searchValue}
|
|
||||||
</if>
|
|
||||||
<if test="createDept != null">
|
|
||||||
and create_dept = #{createDept}
|
|
||||||
</if>
|
|
||||||
<if test="tenantId != null and tenantId != ''">
|
|
||||||
and tenant_id = #{tenantId}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--新增所有列-->
|
|
||||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into cost_pay_fee_audit(house_charge_iditem_idstart_timeend_timereceived_amountreceivable_amountpay_timestateremarkcreate_timecreate_byupdate_timeupdate_bysearch_valuecreate_depttenant_id)
|
|
||||||
values (#{houseChargeId}#{itemId}#{startTime}#{endTime}#{receivedAmount}#{receivableAmount}#{payTime}#{state}#{remark}#{createTime}#{createBy}#{updateTime}#{updateBy}#{searchValue}#{createDept}#{tenantId})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into cost_pay_fee_audit(house_charge_iditem_idstart_timeend_timereceived_amountreceivable_amountpay_timestateremarkcreate_timecreate_byupdate_timeupdate_bysearch_valuecreate_depttenant_id)
|
|
||||||
values
|
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
|
||||||
(#{entity.houseChargeId}#{entity.itemId}#{entity.startTime}#{entity.endTime}#{entity.receivedAmount}#{entity.receivableAmount}#{entity.payTime}#{entity.state}#{entity.remark}#{entity.createTime}#{entity.createBy}#{entity.updateTime}#{entity.updateBy}#{entity.searchValue}#{entity.createDept}#{entity.tenantId})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into cost_pay_fee_audit(house_charge_iditem_idstart_timeend_timereceived_amountreceivable_amountpay_timestateremarkcreate_timecreate_byupdate_timeupdate_bysearch_valuecreate_depttenant_id)
|
|
||||||
values
|
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
|
||||||
(#{entity.houseChargeId}#{entity.itemId}#{entity.startTime}#{entity.endTime}#{entity.receivedAmount}#{entity.receivableAmount}#{entity.payTime}#{entity.state}#{entity.remark}#{entity.createTime}#{entity.createBy}#{entity.updateTime}#{entity.updateBy}#{entity.searchValue}#{entity.createDept}#{entity.tenantId})
|
|
||||||
</foreach>
|
|
||||||
on duplicate key update
|
|
||||||
house_charge_id = values(house_charge_id)item_id = values(item_id)start_time = values(start_time)end_time = values(end_time)received_amount = values(received_amount)receivable_amount = values(receivable_amount)pay_time = values(pay_time)state = values(state)remark = values(remark)create_time = values(create_time)create_by = values(create_by)update_time = values(update_time)update_by = values(update_by)search_value = values(search_value)create_dept = values(create_dept)tenant_id = values(tenant_id)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<!--通过主键修改数据-->
|
|
||||||
<update id="update">
|
|
||||||
update cost_pay_fee_audit
|
|
||||||
<set>
|
|
||||||
<if test="houseChargeId != null">
|
|
||||||
house_charge_id = #{houseChargeId},
|
|
||||||
</if>
|
|
||||||
<if test="itemId != null">
|
|
||||||
item_id = #{itemId},
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
start_time = #{startTime},
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
end_time = #{endTime},
|
|
||||||
</if>
|
|
||||||
<if test="receivedAmount != null">
|
|
||||||
received_amount = #{receivedAmount},
|
|
||||||
</if>
|
|
||||||
<if test="receivableAmount != null">
|
|
||||||
receivable_amount = #{receivableAmount},
|
|
||||||
</if>
|
|
||||||
<if test="payTime != null">
|
|
||||||
pay_time = #{payTime},
|
|
||||||
</if>
|
|
||||||
<if test="state != null and state != ''">
|
|
||||||
state = #{state},
|
|
||||||
</if>
|
|
||||||
<if test="remark != null and remark != ''">
|
|
||||||
remark = #{remark},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time = #{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="createBy != null and createBy != ''">
|
|
||||||
create_by = #{createBy},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">
|
|
||||||
update_by = #{updateBy},
|
|
||||||
</if>
|
|
||||||
<if test="searchValue != null and searchValue != ''">
|
|
||||||
search_value = #{searchValue},
|
|
||||||
</if>
|
|
||||||
<if test="createDept != null">
|
|
||||||
create_dept = #{createDept},
|
|
||||||
</if>
|
|
||||||
<if test="tenantId != null and tenantId != ''">
|
|
||||||
tenant_id = #{tenantId},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<!--通过主键删除-->
|
|
||||||
<delete id="deleteById">
|
|
||||||
delete from cost_pay_fee_audit where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,118 @@
|
|||||||
|
package org.dromara.sis.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceChannelBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceChannelVo;
|
||||||
|
import org.dromara.sis.service.ISisDeviceChannelService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理
|
||||||
|
* 前端访问路由地址为:/sis/deviceChannel
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/deviceChannel")
|
||||||
|
public class SisDeviceChannelController extends BaseController {
|
||||||
|
|
||||||
|
private final ISisDeviceChannelService sisDeviceChannelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备通道管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SisDeviceChannelVo> list(SisDeviceChannelBo bo, PageQuery pageQuery) {
|
||||||
|
return sisDeviceChannelService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备通道树
|
||||||
|
*
|
||||||
|
* @return 返回设备通道树
|
||||||
|
*/
|
||||||
|
@GetMapping("/treeList")
|
||||||
|
public R<List<TreeNode<Long>>> tree() {
|
||||||
|
return R.ok(sisDeviceChannelService.queryTree());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备通道管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:export")
|
||||||
|
@Log(title = "设备通道管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SisDeviceChannelBo bo, HttpServletResponse response) {
|
||||||
|
List<SisDeviceChannelVo> list = sisDeviceChannelService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "设备通道管理", SisDeviceChannelVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备通道管理详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<SisDeviceChannelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(sisDeviceChannelService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备通道管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:add")
|
||||||
|
@Log(title = "设备通道管理", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SisDeviceChannelBo bo) {
|
||||||
|
return toAjax(sisDeviceChannelService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备通道管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:edit")
|
||||||
|
@Log(title = "设备通道管理", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SisDeviceChannelBo bo) {
|
||||||
|
return toAjax(sisDeviceChannelService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备通道管理
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceChannel:remove")
|
||||||
|
@Log(title = "设备通道管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(sisDeviceChannelService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,106 @@
|
|||||||
|
package org.dromara.sis.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceGroupVo;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceGroupBo;
|
||||||
|
import org.dromara.sis.service.ISisDeviceGroupService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理
|
||||||
|
* 前端访问路由地址为:/sis/deviceGroup
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/deviceGroup")
|
||||||
|
public class SisDeviceGroupController extends BaseController {
|
||||||
|
|
||||||
|
private final ISisDeviceGroupService sisDeviceGroupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备组管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SisDeviceGroupVo> list(SisDeviceGroupBo bo, PageQuery pageQuery) {
|
||||||
|
return sisDeviceGroupService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备组管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:export")
|
||||||
|
@Log(title = "设备组管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SisDeviceGroupBo bo, HttpServletResponse response) {
|
||||||
|
List<SisDeviceGroupVo> list = sisDeviceGroupService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "设备组管理", SisDeviceGroupVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备组管理详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<SisDeviceGroupVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(sisDeviceGroupService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备组管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:add")
|
||||||
|
@Log(title = "设备组管理", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SisDeviceGroupBo bo) {
|
||||||
|
return toAjax(sisDeviceGroupService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备组管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:edit")
|
||||||
|
@Log(title = "设备组管理", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SisDeviceGroupBo bo) {
|
||||||
|
return toAjax(sisDeviceGroupService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备组管理
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("sis:deviceGroup:remove")
|
||||||
|
@Log(title = "设备组管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(sisDeviceGroupService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package org.dromara.sis.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理对象 sis_device_channel
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sis_device_channel")
|
||||||
|
public class SisDeviceChannel extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String channelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道分组组id
|
||||||
|
*/
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ip
|
||||||
|
*/
|
||||||
|
private String deviceIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备端口
|
||||||
|
*/
|
||||||
|
private Long devicePort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备账号
|
||||||
|
*/
|
||||||
|
private String deviceAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备密码
|
||||||
|
*/
|
||||||
|
private String devicePwd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备
|
||||||
|
*/
|
||||||
|
private String deviceMac;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道编号
|
||||||
|
*/
|
||||||
|
private String channelNo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package org.dromara.sis.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理对象 sis_device_group
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sis_device_group")
|
||||||
|
public class SisDeviceGroup extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父编码id(-1 表示根节点)
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -53,21 +53,6 @@ public class SisDeviceManage extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer deviceStatus;
|
private Integer deviceStatus;
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级设备id
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机ip
|
|
||||||
*/
|
|
||||||
private String vcrIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机端口
|
|
||||||
*/
|
|
||||||
private Integer vcrPort;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备账号
|
* 设备账号
|
||||||
*/
|
*/
|
||||||
@ -79,19 +64,17 @@ public class SisDeviceManage extends BaseEntity {
|
|||||||
private String devicePwd;
|
private String devicePwd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机账号
|
* 设备类型
|
||||||
*/
|
*/
|
||||||
private String vcrAccount;
|
private Integer deviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机密码
|
* 设备厂商编号
|
||||||
*/
|
*/
|
||||||
private String vcrPwd;
|
private String factoryNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备在录像机的通道编码
|
* 设备组id
|
||||||
*/
|
*/
|
||||||
private String channelNo;
|
private Long groupId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,81 @@
|
|||||||
|
package org.dromara.sis.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceChannel;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理业务对象 sis_device_channel
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = SisDeviceChannel.class, reverseConvertGenerate = false)
|
||||||
|
public class SisDeviceChannelBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "设备id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String channelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道分组组id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "通道分组组id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ip
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备ip不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String deviceIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备端口
|
||||||
|
*/
|
||||||
|
@NotNull(message = "设备端口不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long devicePort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备账号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备账号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String deviceAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备密码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备密码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String devicePwd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备
|
||||||
|
*/
|
||||||
|
private String deviceMac;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道编号
|
||||||
|
*/
|
||||||
|
private String channelNo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package org.dromara.sis.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理业务对象 sis_device_group
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = SisDeviceGroup.class, reverseConvertGenerate = false)
|
||||||
|
public class SisDeviceGroupBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "分组名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父编码id(-1 表示根节点)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "父编码id(-1 表示根节点)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -50,22 +50,6 @@ public class SisDeviceManageBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String deviceMac;
|
private String deviceMac;
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级设备id
|
|
||||||
*/
|
|
||||||
// @NotNull(message = "父级设备id不能为空", groups = {AddGroup.class, EditGroup.class})
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机ip
|
|
||||||
*/
|
|
||||||
private String vcrIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机端口
|
|
||||||
*/
|
|
||||||
private Long vcrPort;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备账号
|
* 设备账号
|
||||||
*/
|
*/
|
||||||
@ -79,19 +63,19 @@ public class SisDeviceManageBo extends BaseEntity {
|
|||||||
private String devicePwd;
|
private String devicePwd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机账号
|
* 设备类型
|
||||||
*/
|
*/
|
||||||
private String vcrAccount;
|
private Integer deviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机密码
|
* 设备厂商编号
|
||||||
*/
|
*/
|
||||||
private String vcrPwd;
|
private String factoryNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备在录像机的通道编码
|
* 设备组id
|
||||||
*/
|
*/
|
||||||
private String channelNo;
|
private Long groupId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
package org.dromara.sis.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceChannel;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理视图对象 sis_device_channel
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = SisDeviceChannel.class)
|
||||||
|
public class SisDeviceChannelVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备id")
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备名称")
|
||||||
|
private String channelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道分组组id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "通道分组组id")
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ip
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备ip")
|
||||||
|
private String deviceIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备端口
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备端口")
|
||||||
|
private Long devicePort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备账号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备账号")
|
||||||
|
private String deviceAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备密码
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备密码")
|
||||||
|
private String devicePwd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备")
|
||||||
|
private String deviceMac;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备通道编号")
|
||||||
|
private String channelNo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package org.dromara.sis.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceGroup;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理视图对象 sis_device_group
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = SisDeviceGroup.class)
|
||||||
|
public class SisDeviceGroupVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "分组名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父编码id(-1 表示根节点)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "父编码id(-1 表示根节点)")
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,21 +1,20 @@
|
|||||||
package org.dromara.sis.domain.vo;
|
package org.dromara.sis.domain.vo;
|
||||||
|
|
||||||
import org.dromara.sis.domain.SisDeviceManage;
|
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.sis.domain.SisDeviceManage;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备管理视图对象 sis_device_manage
|
* 设备管理视图对象 sis_device_manage
|
||||||
*
|
*
|
||||||
* @author mocheng
|
* @author mocheng
|
||||||
* @since 2025-06-26
|
* @since 2025-06-26
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@ -55,24 +54,6 @@ public class SisDeviceManageVo implements Serializable {
|
|||||||
@ExcelProperty(value = "设备")
|
@ExcelProperty(value = "设备")
|
||||||
private String deviceMac;
|
private String deviceMac;
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级设备id
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "父级设备id")
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机ip
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "录像机ip")
|
|
||||||
private String vcrIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录像机端口
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "录像机端口")
|
|
||||||
private Integer vcrPort;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备账号
|
* 设备账号
|
||||||
*/
|
*/
|
||||||
@ -84,20 +65,18 @@ public class SisDeviceManageVo implements Serializable {
|
|||||||
private String devicePwd;
|
private String devicePwd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机账号
|
* 设备类型
|
||||||
*/
|
*/
|
||||||
private String vcrAccount;
|
private Integer deviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录像机密码
|
* 设备厂商编号
|
||||||
*/
|
*/
|
||||||
private String vcrPwd;
|
private String factoryNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备在录像机的通道编码
|
* 设备组id
|
||||||
*/
|
*/
|
||||||
private String channelNo;
|
private Long groupId;
|
||||||
|
|
||||||
private String bindDeviceId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.sis.mapper;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceChannel;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceChannelVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface SisDeviceChannelMapper extends BaseMapperPlus<SisDeviceChannel, SisDeviceChannelVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.sis.mapper;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceGroup;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceGroupVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface SisDeviceGroupMapper extends BaseMapperPlus<SisDeviceGroup, SisDeviceGroupVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package org.dromara.sis.service;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceChannelBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceChannelVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理Service接口
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface ISisDeviceChannelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备通道管理
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 设备通道管理
|
||||||
|
*/
|
||||||
|
SisDeviceChannelVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询设备通道管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 设备通道管理分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SisDeviceChannelVo> queryPageList(SisDeviceChannelBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的设备通道管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 设备通道管理列表
|
||||||
|
*/
|
||||||
|
List<SisDeviceChannelVo> queryList(SisDeviceChannelBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备通道管理
|
||||||
|
*
|
||||||
|
* @param bo 设备通道管理
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SisDeviceChannelBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备通道管理
|
||||||
|
*
|
||||||
|
* @param bo 设备通道管理
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SisDeviceChannelBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除设备通道管理信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备通道树
|
||||||
|
*
|
||||||
|
* @return 返回通道树结构
|
||||||
|
*/
|
||||||
|
List<TreeNode<Long>> queryTree();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package org.dromara.sis.service;
|
||||||
|
|
||||||
|
import org.dromara.sis.domain.SisDeviceGroup;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceGroupVo;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceGroupBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理Service接口
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
public interface ISisDeviceGroupService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备组管理
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 设备组管理
|
||||||
|
*/
|
||||||
|
SisDeviceGroupVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询设备组管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 设备组管理分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SisDeviceGroupVo> queryPageList(SisDeviceGroupBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的设备组管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 设备组管理列表
|
||||||
|
*/
|
||||||
|
List<SisDeviceGroupVo> queryList(SisDeviceGroupBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备组管理
|
||||||
|
*
|
||||||
|
* @param bo 设备组管理
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SisDeviceGroupBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备组管理
|
||||||
|
*
|
||||||
|
* @param bo 设备组管理
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SisDeviceGroupBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除设备组管理信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
List<SisDeviceGroupVo> querAll();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,186 @@
|
|||||||
|
package org.dromara.sis.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.TreeNode;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.core.utils.TreeUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.sis.domain.SisDeviceChannel;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceChannelBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceChannelVo;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceGroupVo;
|
||||||
|
import org.dromara.sis.mapper.SisDeviceChannelMapper;
|
||||||
|
import org.dromara.sis.service.ISisDeviceChannelService;
|
||||||
|
import org.dromara.sis.service.ISisDeviceGroupService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备通道管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SisDeviceChannelServiceImpl implements ISisDeviceChannelService {
|
||||||
|
|
||||||
|
private final SisDeviceChannelMapper baseMapper;
|
||||||
|
private final ISisDeviceGroupService deviceGroupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备通道管理
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 设备通道管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SisDeviceChannelVo queryById(Long id) {
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询设备通道管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 设备通道管理分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SisDeviceChannelVo> queryPageList(SisDeviceChannelBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SisDeviceChannel> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SisDeviceChannelVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的设备通道管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 设备通道管理列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SisDeviceChannelVo> queryList(SisDeviceChannelBo bo) {
|
||||||
|
LambdaQueryWrapper<SisDeviceChannel> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SisDeviceChannel> buildQueryWrapper(SisDeviceChannelBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SisDeviceChannel> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(SisDeviceChannel::getId);
|
||||||
|
lqw.eq(bo.getDeviceId() != null, SisDeviceChannel::getDeviceId, bo.getDeviceId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getChannelName()), SisDeviceChannel::getChannelName, bo.getChannelName());
|
||||||
|
lqw.eq(bo.getGroupId() != null, SisDeviceChannel::getGroupId, bo.getGroupId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceIp()), SisDeviceChannel::getDeviceIp, bo.getDeviceIp());
|
||||||
|
lqw.eq(bo.getDevicePort() != null, SisDeviceChannel::getDevicePort, bo.getDevicePort());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceAccount()), SisDeviceChannel::getDeviceAccount, bo.getDeviceAccount());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDevicePwd()), SisDeviceChannel::getDevicePwd, bo.getDevicePwd());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceMac()), SisDeviceChannel::getDeviceMac, bo.getDeviceMac());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getChannelNo()), SisDeviceChannel::getChannelNo, bo.getChannelNo());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备通道管理
|
||||||
|
*
|
||||||
|
* @param bo 设备通道管理
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SisDeviceChannelBo bo) {
|
||||||
|
SisDeviceChannel add = MapstructUtils.convert(bo, SisDeviceChannel.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备通道管理
|
||||||
|
*
|
||||||
|
* @param bo 设备通道管理
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SisDeviceChannelBo bo) {
|
||||||
|
SisDeviceChannel update = MapstructUtils.convert(bo, SisDeviceChannel.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SisDeviceChannel entity) {
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除设备通道管理信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (isValid) {
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TreeNode<Long>> queryTree() {
|
||||||
|
// 查询设备的分组信息
|
||||||
|
List<SisDeviceGroupVo> ls = deviceGroupService.querAll();
|
||||||
|
if (CollUtil.isEmpty(ls)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
// 查询通道信息
|
||||||
|
List<SisDeviceChannelVo> sisDeviceChannelVos = baseMapper.selectVoList(null);
|
||||||
|
if (CollUtil.isEmpty(sisDeviceChannelVos)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
// 组装树结构
|
||||||
|
List<TreeNode<Long>> treeNodes = new ArrayList<>(ls.size() + sisDeviceChannelVos.size());
|
||||||
|
ls.forEach(item -> {
|
||||||
|
TreeNode<Long> treeNode = new TreeNode<>();
|
||||||
|
treeNode.setLevel(1);
|
||||||
|
treeNode.setCode(item.getId());
|
||||||
|
treeNode.setKey(item.getId());
|
||||||
|
treeNode.setParentCode(item.getParentId());
|
||||||
|
treeNode.setLabel(item.getName());
|
||||||
|
treeNode.setTitle(item.getName());
|
||||||
|
treeNode.setData(item);
|
||||||
|
treeNodes.add(treeNode);
|
||||||
|
});
|
||||||
|
sisDeviceChannelVos.forEach(item -> {
|
||||||
|
TreeNode<Long> treeNode = new TreeNode<>();
|
||||||
|
treeNode.setLevel(2);
|
||||||
|
treeNode.setCode(item.getId());
|
||||||
|
treeNode.setKey(item.getId());
|
||||||
|
treeNode.setParentCode(item.getGroupId());
|
||||||
|
treeNode.setLabel(item.getChannelName());
|
||||||
|
treeNode.setTitle(item.getChannelName());
|
||||||
|
treeNode.setData(item);
|
||||||
|
treeNodes.add(treeNode);
|
||||||
|
});
|
||||||
|
return TreeUtils.build(treeNodes, -1L);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
package org.dromara.sis.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.sis.domain.bo.SisDeviceGroupBo;
|
||||||
|
import org.dromara.sis.domain.vo.SisDeviceGroupVo;
|
||||||
|
import org.dromara.sis.domain.SisDeviceGroup;
|
||||||
|
import org.dromara.sis.mapper.SisDeviceGroupMapper;
|
||||||
|
import org.dromara.sis.service.ISisDeviceGroupService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备组管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author lxj
|
||||||
|
* @date 2025-07-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SisDeviceGroupServiceImpl implements ISisDeviceGroupService {
|
||||||
|
|
||||||
|
private final SisDeviceGroupMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备组管理
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 设备组管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SisDeviceGroupVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询设备组管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 设备组管理分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SisDeviceGroupVo> queryPageList(SisDeviceGroupBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SisDeviceGroup> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SisDeviceGroupVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的设备组管理列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 设备组管理列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SisDeviceGroupVo> queryList(SisDeviceGroupBo bo) {
|
||||||
|
LambdaQueryWrapper<SisDeviceGroup> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SisDeviceGroup> buildQueryWrapper(SisDeviceGroupBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SisDeviceGroup> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(SisDeviceGroup::getId);
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), SisDeviceGroup::getName, bo.getName());
|
||||||
|
lqw.eq(bo.getParentId() != null, SisDeviceGroup::getParentId, bo.getParentId());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备组管理
|
||||||
|
*
|
||||||
|
* @param bo 设备组管理
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SisDeviceGroupBo bo) {
|
||||||
|
SisDeviceGroup add = MapstructUtils.convert(bo, SisDeviceGroup.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备组管理
|
||||||
|
*
|
||||||
|
* @param bo 设备组管理
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SisDeviceGroupBo bo) {
|
||||||
|
SisDeviceGroup update = MapstructUtils.convert(bo, SisDeviceGroup.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SisDeviceGroup entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除设备组管理信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SisDeviceGroupVo> querAll() {
|
||||||
|
return baseMapper.selectVoList(null);
|
||||||
|
}
|
||||||
|
}
|
@ -79,9 +79,8 @@ public class SisDeviceManageServiceImpl implements ISisDeviceManageService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceIp()), SisDeviceManage::getDeviceIp, bo.getDeviceIp());
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceIp()), SisDeviceManage::getDeviceIp, bo.getDeviceIp());
|
||||||
lqw.eq(bo.getDevicePort() != null, SisDeviceManage::getDevicePort, bo.getDevicePort());
|
lqw.eq(bo.getDevicePort() != null, SisDeviceManage::getDevicePort, bo.getDevicePort());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceMac()), SisDeviceManage::getDeviceMac, bo.getDeviceMac());
|
lqw.eq(StringUtils.isNotBlank(bo.getDeviceMac()), SisDeviceManage::getDeviceMac, bo.getDeviceMac());
|
||||||
lqw.eq(bo.getParentId() != null, SisDeviceManage::getParentId, bo.getParentId());
|
lqw.eq(bo.getDeviceType() != null, SisDeviceManage::getDeviceType, bo.getDeviceType());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getVcrIp()), SisDeviceManage::getVcrIp, bo.getVcrIp());
|
lqw.eq(StringUtils.isNotBlank(bo.getFactoryNo()), SisDeviceManage::getFactoryNo, bo.getFactoryNo());
|
||||||
lqw.eq(bo.getVcrPort() != null, SisDeviceManage::getVcrPort, bo.getVcrPort());
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?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="org.dromara.sis.mapper.SisDeviceChannelMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?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="org.dromara.sis.mapper.SisDeviceGroupMapper">
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user