Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
fmboot
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
d65d0afa
由
张雷
编写于
2023-02-06 15:36:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
请求增加项目ID
1 个父辈
234fb62a
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
40 行增加
和
28 行删除
fm-product/src/main/java/com/skua/modules/twin/controller/FmTwinController.java
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinCamera.java
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinEquip.java
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinLocation.java
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinCameraMapper.java
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinEquipMapper.java
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinLocationMapper.java
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinCameraMapper.xml
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinEquipMapper.xml
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinLocationMapper.xml
fm-product/src/main/java/com/skua/modules/twin/service/IFmTwinService.java
fm-product/src/main/java/com/skua/modules/twin/service/impl/FmTwinServiceImpl.java
fm-product/src/main/java/com/skua/modules/twin/controller/FmTwinController.java
查看文件 @
d65d0af
...
...
@@ -89,9 +89,10 @@ public class FmTwinController {
public
Result
<
List
<
FmTwinVO
>>
savePosition
(
@RequestBody
JSONObject
jsonObject
)
{
Result
<
List
<
FmTwinVO
>>
result
=
new
Result
<
List
<
FmTwinVO
>>();
String
twinId
=
jsonObject
.
getString
(
"twinId"
);
String
projectId
=
jsonObject
.
getString
(
"projectId"
);
JSONObject
json
=
jsonObject
.
getJSONObject
(
"locationInfo"
);
FmTwinLocationEntity
fmTwinLocation
=
JSONObject
.
parseObject
(
json
.
toString
(),
FmTwinLocationEntity
.
class
);
boolean
ok
=
fmTwinService
.
savePosition
(
twinId
,
fmTwinLocation
);
boolean
ok
=
fmTwinService
.
savePosition
(
twinId
,
projectId
,
fmTwinLocation
);
if
(
ok
){
result
.
success
(
"定位上传成功!"
);
}
else
{
...
...
@@ -118,9 +119,9 @@ public class FmTwinController {
@AutoLog
(
value
=
"获取孪生体绑定的摄像头信息"
)
@ApiOperation
(
value
=
"获取孪生体绑定的摄像头信息"
,
notes
=
"获取孪生体绑定的摄像头信息"
)
@GetMapping
(
value
=
"/getCameraInfo"
)
public
Result
<
FmTwinCameraResultVO
>
getCameraInfo
(
String
twinId
)
{
public
Result
<
FmTwinCameraResultVO
>
getCameraInfo
(
String
twinId
,
String
projectId
)
{
Result
<
FmTwinCameraResultVO
>
result
=
new
Result
<
FmTwinCameraResultVO
>();
FmTwinCameraResultVO
twinCameraResultVO
=
fmTwinService
.
getCameraInfoByTwinId
(
twinId
);
FmTwinCameraResultVO
twinCameraResultVO
=
fmTwinService
.
getCameraInfoByTwinId
(
twinId
,
projectId
);
result
.
setResult
(
twinCameraResultVO
);
result
.
success
(
"获取成功!"
);
return
result
;
...
...
@@ -144,9 +145,9 @@ public class FmTwinController {
@AutoLog
(
value
=
"获取孪生体绑定的设备信息"
)
@ApiOperation
(
value
=
"获取孪生体绑定的设备信息"
,
notes
=
"获取孪生体绑定的设备信息"
)
@GetMapping
(
value
=
"/getEquipInfo"
)
public
Result
<
FmTwinEquipResultVO
>
getEquipInfo
(
String
twinId
)
{
public
Result
<
FmTwinEquipResultVO
>
getEquipInfo
(
String
twinId
,
String
projectId
)
{
Result
<
FmTwinEquipResultVO
>
result
=
new
Result
<
FmTwinEquipResultVO
>();
FmTwinEquipResultVO
twinEquipResultVO
=
fmTwinService
.
getEquipInfoByTwinId
(
twinId
);
FmTwinEquipResultVO
twinEquipResultVO
=
fmTwinService
.
getEquipInfoByTwinId
(
twinId
,
projectId
);
result
.
setResult
(
twinEquipResultVO
);
result
.
success
(
"获取成功!"
);
return
result
;
...
...
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinCamera.java
查看文件 @
d65d0af
...
...
@@ -33,6 +33,10 @@ public class FmTwinCamera {
@Excel
(
name
=
"孪生体ID"
,
width
=
15
)
@ApiModelProperty
(
value
=
"孪生体ID"
)
private
java
.
lang
.
String
twinId
;
/**所属项目*/
@Excel
(
name
=
"所属项目"
,
width
=
15
)
@ApiModelProperty
(
value
=
"所属项目"
)
private
java
.
lang
.
String
projectId
;
/**摄像头名称*/
@Excel
(
name
=
"摄像头名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"摄像头名称"
)
...
...
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinEquip.java
查看文件 @
d65d0af
...
...
@@ -33,6 +33,10 @@ public class FmTwinEquip {
@Excel
(
name
=
"孪生体ID"
,
width
=
15
)
@ApiModelProperty
(
value
=
"孪生体ID"
)
private
java
.
lang
.
String
twinId
;
/**所属项目*/
@Excel
(
name
=
"所属项目"
,
width
=
15
)
@ApiModelProperty
(
value
=
"所属项目"
)
private
java
.
lang
.
String
projectId
;
/**设备ID*/
@Excel
(
name
=
"设备ID"
,
width
=
15
)
@ApiModelProperty
(
value
=
"设备ID"
)
...
...
fm-product/src/main/java/com/skua/modules/twin/entity/FmTwinLocation.java
查看文件 @
d65d0af
...
...
@@ -33,6 +33,10 @@ public class FmTwinLocation {
@Excel
(
name
=
"孪生体ID"
,
width
=
15
)
@ApiModelProperty
(
value
=
"孪生体ID"
)
private
java
.
lang
.
String
twinId
;
/**所属项目*/
@Excel
(
name
=
"所属项目"
,
width
=
15
)
@ApiModelProperty
(
value
=
"所属项目"
)
private
java
.
lang
.
String
projectId
;
/**位置X坐标*/
@Excel
(
name
=
"位置X坐标"
,
width
=
15
)
@ApiModelProperty
(
value
=
"位置X坐标"
)
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinCameraMapper.java
查看文件 @
d65d0af
...
...
@@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FmTwinCameraMapper
extends
BaseMapper
<
FmTwinCamera
>
{
FmTwinCameraSqlResult
getCameraInfoByTwinId
(
@Param
(
"twinId"
)
String
twinId
);
FmTwinCameraSqlResult
getCameraInfoByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
);
FmTwinCamera
getOneCameraByTwinId
(
@Param
(
"twinId"
)
String
twinId
);
FmTwinCamera
getOneCameraByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
);
}
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinEquipMapper.java
查看文件 @
d65d0af
package
com
.
skua
.
modules
.
twin
.
mapper
;
import
java.util.List
;
import
com.skua.modules.twin.vo.FmTwinEquipSqlResult
;
import
org.apache.ibatis.annotations.Param
;
import
com.skua.modules.twin.entity.FmTwinEquip
;
...
...
@@ -12,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FmTwinEquipMapper
extends
BaseMapper
<
FmTwinEquip
>
{
FmTwinEquipSqlResult
getEquipInfoByTwinId
(
@Param
(
"twinId"
)
String
twinId
);
FmTwinEquipSqlResult
getEquipInfoByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
);
FmTwinEquip
getOneEquipByTwinId
(
@Param
(
"twinId"
)
String
twinId
);
FmTwinEquip
getOneEquipByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
);
}
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/FmTwinLocationMapper.java
查看文件 @
d65d0af
...
...
@@ -9,5 +9,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FmTwinLocationMapper
extends
BaseMapper
<
FmTwinLocation
>
{
FmTwinLocation
getOneByTwinId
(
@Param
(
"twinId"
)
String
twinId
);
FmTwinLocation
getOneByTwinId
(
@Param
(
"twinId"
)
String
twinId
,
@Param
(
"projectId"
)
String
projectId
);
}
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinCameraMapper.xml
查看文件 @
d65d0af
...
...
@@ -18,11 +18,12 @@
LEFT JOIN fm_twin_camera c ON m.twin_id = c.twin_id
WHERE
m.twin_id = #{twinId}
and m.project_id = #{projectId}
LIMIT 1
</select>
<select
id=
"getOneCameraByTwinId"
resultType=
"com.skua.modules.twin.entity.FmTwinCamera"
>
select * from fm_twin_camera where twin_id = #{twinId}
select * from fm_twin_camera where twin_id = #{twinId}
and project_id = #{projectId} limit 1
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinEquipMapper.xml
查看文件 @
d65d0af
...
...
@@ -17,11 +17,12 @@
LEFT JOIN fm_twin_equip e ON m.twin_id = e.twin_id
WHERE
m.twin_id = #{twinId}
and m.project_id = #{projectId}
LIMIT 1
</select>
<select
id=
"getOneEquipByTwinId"
resultType=
"com.skua.modules.twin.entity.FmTwinEquip"
>
select * from fm_twin_equip where twin_id = #{twinId}
select * from fm_twin_equip where twin_id = #{twinId}
and project_id = #{projectId} limit 1
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/twin/mapper/xml/FmTwinLocationMapper.xml
查看文件 @
d65d0af
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.skua.modules.twin.mapper.FmTwinLocationMapper"
>
<select
id=
"getOneByTwinId"
resultType=
"com.skua.modules.twin.entity.FmTwinLocation"
>
select * from fm_twin_location where twin_id = #{twinId} limit 1
select * from fm_twin_location where twin_id = #{twinId}
and project_id = #{projectId}
limit 1
</select>
</mapper>
\ No newline at end of file
...
...
fm-product/src/main/java/com/skua/modules/twin/service/IFmTwinService.java
查看文件 @
d65d0af
...
...
@@ -16,13 +16,13 @@ public interface IFmTwinService {
List
<
FmTwinResultVO
>
queryList
(
FmTwinQueryVO
fmTwinQueryVO
);
boolean
savePosition
(
String
twinId
,
FmTwinLocationEntity
fmTwinLocation
);
boolean
savePosition
(
String
twinId
,
String
projectId
,
FmTwinLocationEntity
fmTwinLocation
);
boolean
saveNameAndType
(
FmTwinManage
fmTwinManage
);
FmTwinCameraResultVO
getCameraInfoByTwinId
(
String
twinId
);
FmTwinCameraResultVO
getCameraInfoByTwinId
(
String
twinId
,
String
projectId
);
FmTwinEquipResultVO
getEquipInfoByTwinId
(
String
twinId
);
FmTwinEquipResultVO
getEquipInfoByTwinId
(
String
twinId
,
String
projectId
);
boolean
boundCamera
(
FmTwinCamera
fmTwinCamera
);
...
...
fm-product/src/main/java/com/skua/modules/twin/service/impl/FmTwinServiceImpl.java
查看文件 @
d65d0af
...
...
@@ -79,16 +79,17 @@ public class FmTwinServiceImpl implements IFmTwinService {
}
@Override
public
boolean
savePosition
(
String
twinId
,
FmTwinLocationEntity
twinLocationEntity
)
{
public
boolean
savePosition
(
String
twinId
,
String
projectId
,
FmTwinLocationEntity
twinLocationEntity
)
{
FmTwinLocation
fmTwinLocation
=
new
FmTwinLocation
();
fmTwinLocation
.
setTwinId
(
twinId
);
fmTwinLocation
.
setProjectId
(
projectId
);
fmTwinLocation
.
setLocaX
(
twinLocationEntity
.
getLocaX
());
fmTwinLocation
.
setLocaY
(
twinLocationEntity
.
getLocaY
());
fmTwinLocation
.
setLocaZ
(
twinLocationEntity
.
getLocaZ
());
fmTwinLocation
.
setRotateX
(
twinLocationEntity
.
getRotateX
());
fmTwinLocation
.
setRotateY
(
twinLocationEntity
.
getRotateY
());
fmTwinLocation
.
setRotateZ
(
twinLocationEntity
.
getRotateZ
());
FmTwinLocation
location
=
fmTwinLocationMapper
.
getOneByTwinId
(
twinId
);
FmTwinLocation
location
=
fmTwinLocationMapper
.
getOneByTwinId
(
twinId
,
projectId
);
int
count
=
0
;
if
(
location
==
null
){
count
=
fmTwinLocationMapper
.
insert
(
fmTwinLocation
);
...
...
@@ -118,8 +119,8 @@ public class FmTwinServiceImpl implements IFmTwinService {
}
@Override
public
FmTwinCameraResultVO
getCameraInfoByTwinId
(
String
twinId
)
{
FmTwinCameraSqlResult
twinCameraSqlResult
=
fmTwinCameraMapper
.
getCameraInfoByTwinId
(
twinId
);
public
FmTwinCameraResultVO
getCameraInfoByTwinId
(
String
twinId
,
String
projectId
)
{
FmTwinCameraSqlResult
twinCameraSqlResult
=
fmTwinCameraMapper
.
getCameraInfoByTwinId
(
twinId
,
projectId
);
FmTwinCameraResultVO
twinCameraResultVO
=
new
FmTwinCameraResultVO
();
CameraEntity
twinCameraEntity
=
new
CameraEntity
();
twinCameraResultVO
.
setTwinId
(
twinCameraSqlResult
.
getTwinId
());
...
...
@@ -136,8 +137,8 @@ public class FmTwinServiceImpl implements IFmTwinService {
}
@Override
public
FmTwinEquipResultVO
getEquipInfoByTwinId
(
String
twinId
)
{
FmTwinEquipSqlResult
twinEquipSqlResult
=
fmTwinEquipMapper
.
getEquipInfoByTwinId
(
twinId
);
public
FmTwinEquipResultVO
getEquipInfoByTwinId
(
String
twinId
,
String
projectId
)
{
FmTwinEquipSqlResult
twinEquipSqlResult
=
fmTwinEquipMapper
.
getEquipInfoByTwinId
(
twinId
,
projectId
);
FmTwinEquipResultVO
twinEquipResultVO
=
new
FmTwinEquipResultVO
();
twinEquipResultVO
.
setTwinId
(
twinEquipSqlResult
.
getTwinId
());
twinEquipResultVO
.
setTwinName
(
twinEquipSqlResult
.
getTwinName
());
...
...
@@ -155,8 +156,7 @@ public class FmTwinServiceImpl implements IFmTwinService {
@Override
public
boolean
boundCamera
(
FmTwinCamera
fmTwinCamera
)
{
int
count
=
0
;
String
twinId
=
fmTwinCamera
.
getTwinId
();
FmTwinCamera
fmTwinCameraEntity
=
fmTwinCameraMapper
.
getOneCameraByTwinId
(
twinId
);
FmTwinCamera
fmTwinCameraEntity
=
fmTwinCameraMapper
.
getOneCameraByTwinId
(
fmTwinCamera
.
getTwinId
(),
fmTwinCamera
.
getProjectId
());
if
(
fmTwinCameraEntity
!=
null
){
fmTwinCamera
.
setId
(
fmTwinCameraEntity
.
getId
());
count
=
fmTwinCameraMapper
.
updateById
(
fmTwinCamera
);
...
...
@@ -173,8 +173,7 @@ public class FmTwinServiceImpl implements IFmTwinService {
@Override
public
boolean
boundEquip
(
FmTwinEquip
fmTwinEquip
)
{
int
count
=
0
;
String
twinId
=
fmTwinEquip
.
getTwinId
();
FmTwinEquip
fmTwinEquipEntity
=
fmTwinEquipMapper
.
getOneEquipByTwinId
(
twinId
);
FmTwinEquip
fmTwinEquipEntity
=
fmTwinEquipMapper
.
getOneEquipByTwinId
(
fmTwinEquip
.
getTwinId
(),
fmTwinEquip
.
getProjectId
());
if
(
fmTwinEquipEntity
!=
null
){
fmTwinEquip
.
setId
(
fmTwinEquipEntity
.
getId
());
count
=
fmTwinEquipMapper
.
updateById
(
fmTwinEquip
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论