Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RuoYi-Vue-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI算法平台
RuoYi-Vue-master
Commits
f84476aa
Commit
f84476aa
authored
Mar 26, 2024
by
baoxiaode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
算法摄像头新增通知算法端
parent
b616ce08
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
82 deletions
+72
-82
ruoyi-admin/src/main/java/com/ruoyi/algorithm/controller/AlgorithmCameraBaseController.java
...i/algorithm/controller/AlgorithmCameraBaseController.java
+40
-1
ruoyi-admin/src/main/java/com/ruoyi/algorithm/domain/AlgorithmCameraBase.java
.../java/com/ruoyi/algorithm/domain/AlgorithmCameraBase.java
+7
-79
ruoyi-admin/src/main/java/com/ruoyi/algorithm/domain/dto/AlgorithmCameraListDto.java
...om/ruoyi/algorithm/domain/dto/AlgorithmCameraListDto.java
+4
-0
ruoyi-admin/src/main/resources/application.yml
ruoyi-admin/src/main/resources/application.yml
+4
-0
ruoyi-admin/src/main/resources/mapper/system/AlgorithmCameraBaseMapper.xml
...ain/resources/mapper/system/AlgorithmCameraBaseMapper.xml
+17
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/algorithm/controller/AlgorithmCameraBaseController.java
View file @
f84476aa
...
...
@@ -3,7 +3,11 @@ package com.ruoyi.algorithm.controller;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.algorithm.domain.dto.AlgorithmCameraListDto
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -33,6 +37,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping
(
"/system/algorithm/camera/base"
)
public
class
AlgorithmCameraBaseController
extends
BaseController
{
@Value
(
"${ai.camera.url}"
)
private
String
aiCameraUrl
;
@Autowired
private
IAlgorithmCameraBaseService
algorithmCameraBaseService
;
...
...
@@ -77,7 +85,23 @@ public class AlgorithmCameraBaseController extends BaseController
public
AjaxResult
add
(
@RequestBody
AlgorithmCameraBase
algorithmCameraBase
)
{
algorithmCameraBase
.
setCreateBy
(
getUsername
());
return
toAjax
(
algorithmCameraBaseService
.
insertAlgorithmCameraBase
(
algorithmCameraBase
));
algorithmCameraBaseService
.
insertAlgorithmCameraBase
(
algorithmCameraBase
);
//算法平台通知
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"AllAlgorithmPtype"
,
""
);
JSONArray
cameraList
=
new
JSONArray
();
JSONObject
camera
=
new
JSONObject
();
camera
.
put
(
"inputDataPath"
,
algorithmCameraBase
.
getRtsp
());
camera
.
put
(
"selectalgorithmPtype"
,
algorithmCameraBase
.
getAlgorithmType
());
camera
.
put
(
"cameraName"
,
algorithmCameraBase
.
getCameraNo
());
cameraList
.
add
(
camera
);
param
.
put
(
"cameraList"
,
cameraList
);
try
{
HttpUtil
.
createGet
(
aiCameraUrl
).
body
(
param
.
toJSONString
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
AjaxResult
.
success
();
}
/**
...
...
@@ -89,6 +113,21 @@ public class AlgorithmCameraBaseController extends BaseController
public
AjaxResult
edit
(
@RequestBody
AlgorithmCameraBase
algorithmCameraBase
)
{
algorithmCameraBase
.
setUpdateBy
(
getUsername
());
//算法平台通知
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"AllAlgorithmPtype"
,
""
);
JSONArray
cameraList
=
new
JSONArray
();
JSONObject
camera
=
new
JSONObject
();
camera
.
put
(
"inputDataPath"
,
algorithmCameraBase
.
getRtsp
());
camera
.
put
(
"selectalgorithmPtype"
,
algorithmCameraBase
.
getAlgorithmType
());
camera
.
put
(
"cameraName"
,
algorithmCameraBase
.
getCameraNo
());
cameraList
.
add
(
camera
);
param
.
put
(
"cameraList"
,
cameraList
);
try
{
HttpUtil
.
createGet
(
aiCameraUrl
).
body
(
param
.
toJSONString
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
toAjax
(
algorithmCameraBaseService
.
updateAlgorithmCameraBase
(
algorithmCameraBase
));
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/algorithm/domain/AlgorithmCameraBase.java
View file @
f84476aa
package
com
.
ruoyi
.
algorithm
.
domain
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.annotation.Excel
;
...
...
@@ -11,6 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2023-04-26
*/
@Data
public
class
AlgorithmCameraBase
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -22,6 +24,9 @@ public class AlgorithmCameraBase extends BaseEntity
@Excel
(
name
=
"摄像头名"
)
private
String
cameraName
;
@Excel
(
name
=
"摄像头编号"
)
private
String
cameraNo
;
/** 摄像头视频流地址 */
@Excel
(
name
=
"摄像头视频流地址"
)
private
String
rtsp
;
...
...
@@ -41,83 +46,6 @@ public class AlgorithmCameraBase extends BaseEntity
/** 删除标志(0代表存在 */
private
String
delFlag
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setCameraName
(
String
cameraName
)
{
this
.
cameraName
=
cameraName
;
}
public
String
getCameraName
()
{
return
cameraName
;
}
public
void
setRtsp
(
String
rtsp
)
{
this
.
rtsp
=
rtsp
;
}
public
String
getRtsp
()
{
return
rtsp
;
}
public
void
setSort
(
Long
sort
)
{
this
.
sort
=
sort
;
}
public
Long
getSort
()
{
return
sort
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
String
getBelong
()
{
return
belong
;
}
public
void
setBelong
(
String
belong
)
{
this
.
belong
=
belong
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"cameraName"
,
getCameraName
())
.
append
(
"rtsp"
,
getRtsp
())
.
append
(
"sort"
,
getSort
())
.
append
(
"status"
,
getStatus
())
.
append
(
"delFlag"
,
getDelFlag
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
@Excel
(
name
=
"摄像头支持的算法类型"
)
private
String
algorithmType
;
}
ruoyi-admin/src/main/java/com/ruoyi/algorithm/domain/dto/AlgorithmCameraListDto.java
View file @
f84476aa
...
...
@@ -31,4 +31,8 @@ public class AlgorithmCameraListDto {
/** 状态 */
private
String
status
;
private
String
algorithmType
;
private
String
cameraNo
;
}
ruoyi-admin/src/main/resources/application.yml
View file @
f84476aa
...
...
@@ -149,6 +149,10 @@ airestapi:
host
:
localhost
# 端口,默认为8081
port
:
8081
#Ai向摄像头发送地址
ai
:
camera
:
url
:
http://172.16.121.2:8000/conf
#大华ICC视频配置
icc
:
...
...
ruoyi-admin/src/main/resources/mapper/system/AlgorithmCameraBaseMapper.xml
View file @
f84476aa
...
...
@@ -17,10 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"cameraNo"
column=
"camera_no"
/>
<result
property=
"algorithmType"
column=
"algorithm_type"
/>
</resultMap>
<resultMap
type=
"com.ruoyi.algorithm.domain.dto.AlgorithmCameraListDto"
id=
"AlgorithmCameraListDtoResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"cameraNo"
column=
"camera_no"
/>
<result
property=
"cameraName"
column=
"camera_name"
/>
<result
property=
"rtsp"
column=
"rtsp"
/>
<result
property=
"createBy"
column=
"nick_name"
/>
...
...
@@ -28,10 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"belong"
column=
"belong"
/>
<result
property=
"algorithmType"
column=
"algorithm_type"
/>
</resultMap>
<sql
id=
"selectAlgorithmCameraBaseVo"
>
select id, camera_name, rtsp, sort, belong,status, del_flag, create_by, create_time, update_by, update_time, remark from algorithm_camera_base
select id, camera_name, rtsp, sort, belong,status, del_flag, create_by,camera_no,algorithm_type,
create_time, update_by, update_time, remark from algorithm_camera_base
</sql>
<select
id=
"selectAlgorithmCameraBaseList"
parameterType=
"AlgorithmCameraBase"
resultMap=
"AlgorithmCameraBaseResult"
>
...
...
@@ -41,6 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"rtsp != null and rtsp != ''"
>
and rtsp = #{rtsp}
</if>
<if
test=
"sort != null "
>
and sort = #{sort}
</if>
<if
test=
"status != null and status != ''"
>
and status = #{status}
</if>
<if
test=
"cameraNo != null and cameraNo != ''"
>
and camera_no = #{cameraNo}
</if>
<if
test=
"algorithmType != null and algorithmType != ''"
>
and algorithm_type = #{algorithmType}
</if>
</where>
</select>
...
...
@@ -57,7 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
acb.create_time,
acb.sort,
acb.belong,
acb.`status`
acb.`status`,
acb.camera_no,
acb.algorithm_type
FROM
algorithm_camera_base acb
LEFT JOIN sys_user su ON su.user_name = acb.create_by
...
...
@@ -94,6 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"cameraNo != null"
>
camera_no,
</if>
<if
test=
"algorithmType != null"
>
algorithm_type,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
...
...
@@ -108,6 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"cameraNo != null"
>
#{cameraNo},
</if>
<if
test=
"algorithmType != null"
>
#{algorithmType},
</if>
</trim>
</insert>
...
...
@@ -125,6 +138,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"algorithmType != null"
>
algorithm_type = #{algorithmType},
</if>
<if
test=
"cameraNo != null"
>
camera_no = #{cameraNo},
</if>
</trim>
where id = #{id}
</update>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment