Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
王浩
zh-baseversion-project
Commits
470f2906
Commit
470f2906
authored
Jul 25, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 运行检测下 视频监控 企业数据监控 预警信息 调整成 政府 和 企业都可以录,企业查看自己数据,政府查看所有企业数据逻辑。
parent
2de0756e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
9 deletions
+74
-9
TVideoManagerController.java
.../zehong/web/controller/video/TVideoManagerController.java
+21
-1
TDetectorInfo.java
...src/main/java/com/zehong/system/domain/TDetectorInfo.java
+3
-3
TDeviceReportData.java
...main/java/com/zehong/system/domain/TDeviceReportData.java
+8
-4
TDetectorInfoServiceImpl.java
.../zehong/system/service/impl/TDetectorInfoServiceImpl.java
+19
-0
TDeviceReportDataServiceImpl.java
...ong/system/service/impl/TDeviceReportDataServiceImpl.java
+23
-1
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/video/TVideoManagerController.java
View file @
470f2906
...
...
@@ -3,8 +3,10 @@ package com.zehong.web.controller.video;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.domain.entity.SysRole
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.system.domain.TEnterpriseInfo
;
import
com.zehong.system.domain.TVideoManager
;
...
...
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 视频管理Controller
...
...
@@ -73,8 +76,13 @@ public class TVideoManagerController extends BaseController
enterpriseVideoFirst
.
setVideoName
(
"视频监控"
);
enterpriseVideoFirst
.
setLevel
(
"1"
);
TEnterpriseInfo
tEnterpriseInfo1
=
new
TEnterpriseInfo
();
// 如果是企业的话,就只查该企业下的数据
if
(
isEnterprise
())
{
tEnterpriseInfo1
.
setEnterpriseId
(
SecurityUtils
.
getLoginUser
().
getUser
().
getDeptId
());
}
List
<
TEnterpriseInfo
>
tEnterpriseInfos
=
itEmployedPeopleInfoService
.
selectTEnterpriseInfoList
(
new
TEnterpriseInfo
()
);
List
<
TEnterpriseInfo
>
tEnterpriseInfos
=
itEmployedPeopleInfoService
.
selectTEnterpriseInfoList
(
tEnterpriseInfo1
);
/*TEnterpriseInfo cg=new TEnterpriseInfo();
cg.setEnterpriseId(new Long(0));
cg.setEnterpriseName("城管视频");
...
...
@@ -149,4 +157,16 @@ public class TVideoManagerController extends BaseController
{
return
toAjax
(
tVideoManagerService
.
deleteTVideoManagerByIds
(
videoManagerIds
));
}
/**
* 判断是否为企业
* @return
*/
private
boolean
isEnterprise
(){
List
<
SysRole
>
roles
=
SecurityUtils
.
getLoginUser
().
getUser
().
getRoles
();
List
<
String
>
roleKeys
=
roles
.
stream
().
map
(
item
->
item
.
getRoleKey
()).
collect
(
Collectors
.
toList
());
return
roleKeys
.
contains
(
"qy"
);
}
}
zh-baseversion-system/src/main/java/com/zehong/system/domain/TDetectorInfo.java
View file @
470f2906
...
...
@@ -20,7 +20,7 @@ public class TDetectorInfo extends BaseEntity
private
Long
detectorId
;
/** 企业id */
private
Integer
enterpriseId
;
private
String
enterpriseId
;
/** 用户id */
@Excel
(
name
=
"用户id"
)
...
...
@@ -116,11 +116,11 @@ public class TDetectorInfo extends BaseEntity
return
detectorId
;
}
public
Integer
getEnterpriseId
()
{
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/domain/TDeviceReportData.java
View file @
470f2906
...
...
@@ -75,8 +75,8 @@ public class TDeviceReportData extends BaseEntity
private
String
deviceStatus
;
/** 所属企业id */
@Excel
(
name
=
"所属企业id"
)
private
Lo
ng
beyondEnterpriseId
;
//
@Excel(name = "所属企业id")
private
Stri
ng
beyondEnterpriseId
;
/** 所属企业名称 */
@Excel
(
name
=
"所属企业名称"
)
...
...
@@ -92,6 +92,10 @@ public class TDeviceReportData extends BaseEntity
private
String
beyondDeviceName
;
/**
* 1 压力表
* 2 流量计
*/
private
String
deviceType
;
public
String
getDeviceType
()
{
...
...
@@ -236,12 +240,12 @@ public class TDeviceReportData extends BaseEntity
{
return
deviceStatus
;
}
public
void
setBeyondEnterpriseId
(
Long
beyondEnterpriseId
)
public
void
setBeyondEnterpriseId
(
String
beyondEnterpriseId
)
{
this
.
beyondEnterpriseId
=
beyondEnterpriseId
;
}
public
Long
getBeyondEnterpriseId
()
public
String
getBeyondEnterpriseId
()
{
return
beyondEnterpriseId
;
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TDetectorInfoServiceImpl.java
View file @
470f2906
package
com
.
zehong
.
system
.
service
.
impl
;
import
com.github.pagehelper.PageInfo
;
import
com.zehong.common.core.domain.entity.SysRole
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.mapper.TDetectorInfoMapper
;
import
com.zehong.system.service.ITDetectorInfoService
;
...
...
@@ -9,6 +11,7 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 探测器Service业务层处理
...
...
@@ -164,6 +167,22 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
*/
@Override
public
List
<
TDetectorInfo
>
selectDetectorMointor
(
TDetectorInfo
tDetectorInfo
){
// 20240725调整 如果是企业,则只查企业的数据
if
(
isEnterprise
())
{
tDetectorInfo
.
setEnterpriseId
(
SecurityUtils
.
getLoginUser
().
getUser
().
getDeptId
());
}
return
tDetectorInfoMapper
.
selectDetectorMointor
(
tDetectorInfo
);
}
/**
* 判断是否为企业
* @return
*/
private
boolean
isEnterprise
(){
List
<
SysRole
>
roles
=
SecurityUtils
.
getLoginUser
().
getUser
().
getRoles
();
List
<
String
>
roleKeys
=
roles
.
stream
().
map
(
item
->
item
.
getRoleKey
()).
collect
(
Collectors
.
toList
());
return
roleKeys
.
contains
(
"qy"
);
}
}
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TDeviceReportDataServiceImpl.java
View file @
470f2906
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.zehong.common.core.domain.entity.SysRole
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TDeviceReportDataMapper
;
import
com.zehong.system.domain.TDeviceReportData
;
import
com.zehong.system.service.ITDeviceReportDataService
;
import
javax.annotation.Resource
;
/**
* 设备监控Service业务层处理
*
...
...
@@ -17,7 +23,7 @@ import com.zehong.system.service.ITDeviceReportDataService;
@Service
public
class
TDeviceReportDataServiceImpl
implements
ITDeviceReportDataService
{
@
Autowired
@
Resource
private
TDeviceReportDataMapper
tDeviceReportDataMapper
;
/**
...
...
@@ -41,6 +47,11 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
@Override
public
List
<
TDeviceReportData
>
selectTDeviceReportDataList
(
TDeviceReportData
tDeviceReportData
)
{
// 20240725 调整 分 企业 和 政府 角色录入
if
(
isEnterprise
())
{
tDeviceReportData
.
setBeyondEnterpriseId
(
SecurityUtils
.
getLoginUser
().
getUser
().
getDeptId
());
}
return
tDeviceReportDataMapper
.
selectTDeviceReportDataList
(
tDeviceReportData
);
}
...
...
@@ -93,4 +104,15 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
{
return
tDeviceReportDataMapper
.
deleteTDeviceReportDataById
(
deviceReportDataId
);
}
/**
* 判断是否为企业
* @return
*/
private
boolean
isEnterprise
(){
List
<
SysRole
>
roles
=
SecurityUtils
.
getLoginUser
().
getUser
().
getRoles
();
List
<
String
>
roleKeys
=
roles
.
stream
().
map
(
item
->
item
.
getRoleKey
()).
collect
(
Collectors
.
toList
());
return
roleKeys
.
contains
(
"qy"
);
}
}
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