Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
27bc6c53
Commit
27bc6c53
authored
Aug 13, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安全预控基础升级
parent
f34c5c44
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
681 additions
and
647 deletions
+681
-647
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+18
-17
AbstractBaseController.java
.../amos/fas/business/controller/AbstractBaseController.java
+164
-177
AccidentTypeController.java
.../amos/fas/business/controller/AccidentTypeController.java
+6
-6
AlarmController.java
...yeejoin/amos/fas/business/controller/AlarmController.java
+3
-2
BizMessageController.java
...in/amos/fas/business/controller/BizMessageController.java
+4
-3
CommonController.java
...eejoin/amos/fas/business/controller/CommonController.java
+7
-7
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+10
-9
CurCompanyController.java
...in/amos/fas/business/controller/CurCompanyController.java
+3
-2
DataRefreshController.java
...n/amos/fas/business/controller/DataRefreshController.java
+3
-2
DictController.java
.../yeejoin/amos/fas/business/controller/DictController.java
+10
-9
EquipmentController.java
...oin/amos/fas/business/controller/EquipmentController.java
+19
-18
EquipmentSpecificIndexController.java
...business/controller/EquipmentSpecificIndexController.java
+4
-3
EvaModelController.java
...join/amos/fas/business/controller/EvaModelController.java
+3
-2
ExcelController.java
...yeejoin/amos/fas/business/controller/ExcelController.java
+6
-5
FileController.java
.../yeejoin/amos/fas/business/controller/FileController.java
+26
-25
FireEquimtPointController.java
...os/fas/business/controller/FireEquimtPointController.java
+10
-9
FireRectificationController.java
.../fas/business/controller/FireRectificationController.java
+6
-5
FireSourceController.java
...in/amos/fas/business/controller/FireSourceController.java
+11
-10
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+9
-8
RiskFactorController.java
...in/amos/fas/business/controller/RiskFactorController.java
+6
-5
RiskLevelController.java
...oin/amos/fas/business/controller/RiskLevelController.java
+7
-6
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+11
-10
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+34
-33
SafetyController.java
...eejoin/amos/fas/business/controller/SafetyController.java
+1
-1
StationMaintenController.java
...mos/fas/business/controller/StationMaintenController.java
+4
-3
TimeLineController.java
...join/amos/fas/business/controller/TimeLineController.java
+14
-50
TopographyController.java
...in/amos/fas/business/controller/TopographyController.java
+8
-7
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+26
-25
WeatherController.java
...ejoin/amos/fas/business/controller/WeatherController.java
+3
-2
FireScheduled.java
...om/yeejoin/amos/fas/business/scheduled/FireScheduled.java
+58
-0
Permission.java
...src/main/java/com/yeejoin/amos/fas/config/Permission.java
+14
-14
PermissionAspect.java
...in/java/com/yeejoin/amos/fas/config/PermissionAspect.java
+167
-167
InputItemController.java
.../maintenance/business/controller/InputItemController.java
+2
-1
InputItemController.java
.../amos/patrol/business/controller/InputItemController.java
+1
-1
FireAutoSysApplication.java
...rc/main/java/com/yeejoin/amos/FireAutoSysApplication.java
+3
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
27bc6c53
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
aop
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
...
...
@@ -22,13 +16,20 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
/**
* controller层切面 用于用户数据缓存 供 sql自动填充使用
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/AbstractBaseController.java
View file @
27bc6c53
...
...
@@ -2,31 +2,18 @@ package com.yeejoin.amos.fas.business.controller;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.ConstraintViolationException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.transaction.TransactionSystemException
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.enums.QueryOperatorEnum
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -39,53 +26,53 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Deprecated
public
abstract
class
AbstractBaseController
extends
BaseController
{
@Autowired
protected
HttpServletRequest
request
;
/**
* 成功返回状态
*/
protected
static
final
String
SUCCESS
=
"SUCCESS"
;
/**
* 失败返回状态
*/
protected
static
final
String
FAILED
=
"FAILED"
;
/**
* 默认页大小
*/
protected
static
final
int
DEFAULT_PAGE_SIZE
=
10
;
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
protected
String
getToken
()
{
String
authToken
=
request
.
getHeader
(
"token"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
}
return
authToken
;
}
protected
String
getProduct
()
{
String
authToken
=
request
.
getHeader
(
"product"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getParameter
(
"product"
);
}
return
authToken
;
}
protected
String
getAppKey
()
{
String
authToken
=
request
.
getHeader
(
"appKey"
);
if
(
authToken
==
null
)
{
authToken
=
request
.
getParameter
(
"appKey"
);
}
return
authToken
;
}
// @Autowired
// protected HttpServletRequest request;
//
// /**
// * 成功返回状态
// */
// protected static final String SUCCESS = "SUCCESS";
//
// /**
// * 失败返回状态
// */
// protected static final String FAILED = "FAILED";
//
// /**
// * 默认页大小
// */
// protected static final int DEFAULT_PAGE_SIZE = 10;
//
// @Autowired
// private RedisTemplate<String, String> redisTemplate;
//
//
// protected String getToken() {
// String authToken = request.getHeader("token");
// if (authToken == null) {
// authToken = request.getHeader("X-Access-Token");
// }
// return authToken;
// }
// protected String getProduct() {
// String authToken = request.getHeader("product");
// if (authToken == null) {
// authToken = request.getParameter("product");
// }
// return authToken;
// }
//
//
// protected String getAppKey() {
// String authToken = request.getHeader("appKey");
// if (authToken == null) {
// authToken = request.getParameter("appKey");
// }
// return authToken;
// }
//
protected
String
getChannelType
()
{
String
channelType
=
request
.
getHeader
(
"channelType"
);
if
(
channelType
==
null
)
{
...
...
@@ -93,21 +80,21 @@ public abstract class AbstractBaseController extends BaseController {
}
return
channelType
;
}
//redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
//return "region_" + userId + "_" + token.substring(0, token.indexOf('_', 1));
return
"region_"
+
userId
+
"_"
+
token
;
}
protected
void
saveSelectedOrgInfo
(
ReginParams
reginParams
)
{
redisTemplate
.
opsForValue
().
set
(
buildKey
(
getUserId
(),
getToken
()),
JSONObject
.
toJSONString
(
reginParams
));
}
//
// //redi缓存选择的用户信息
// private String buildKey(String userId, String token) {
// //return "region_" + userId + "_" + token.substring(0, token.indexOf('_', 1));
// return "region_" + userId + "_" + token;
//
// }
protected
ReginParams
getSelectedOrgInfo
()
{
return
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
getUserId
(),
getToken
())),
ReginParams
.
class
);
}
// protected void saveSelectedOrgInfo(ReginParams reginParams) {
// redisTemplate.opsForValue().set(buildKey(getUserId(), getToken()), JSONObject.toJSONString(reginParams));
// }
//
// protected ReginParams getSelectedOrgInfo() {
// return JSON.parseObject(redisTemplate.opsForValue().get(buildKey(getUserId(), getToken())), ReginParams.class);
// }
/**
*
...
...
@@ -136,115 +123,115 @@ public abstract class AbstractBaseController extends BaseController {
return getUserInfo().getRole().getRoleType().toString();
}*/
/**
* 当前登录用户信息
*/
protected
AgencyUserModel
getUserInfo
()
{
AgencyUserModel
userModel
=
null
;
if
(
getToken
()!=
null
){
RequestContext
.
setToken
(
getToken
());
RequestContext
.
setProduct
(
getProduct
());
RequestContext
.
setAppKey
(
getAppKey
());
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
userModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
}
return
userModel
;
// return CurrentAuthentication.getAuthenticatedUserThreadLocal();
}
protected
String
getUserId
()
{
String
userId
=
null
;
if
(
getUserInfo
()
!=
null
)
{
userId
=
getUserInfo
().
getUserId
();
}
return
userId
;
}
protected
String
getCompanyId
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getSequenceNbr
().
toString
();
}
return
null
;
}
/**
* 获取当前用户所属公司名称
* @return
*/
protected
String
getCurrentCompanyNameOfUser
()
{
if
(
getUserInfo
()
==
null
)
{
return
""
;
}
return
getSelectedOrgInfo
().
getCompany
().
getCompanyName
();
}
// /**
// * 当前登录用户信息
// */
// protected AgencyUserModel getUserInfo() {
// AgencyUserModel userModel=null;
// if(getToken()!=null){
// RequestContext.setToken(getToken());
// RequestContext.setProduct(getProduct());
// RequestContext.setAppKey(getAppKey());
// FeignClientResult feignClientResult;
// try {
// feignClientResult = Privilege.agencyUserClient.getme();
// userModel = (AgencyUserModel) feignClientResult.getResult();
//
// } catch (InnerInvokException e) {
// e.printStackTrace();
// }
//
// }
// return userModel;
//
// // return CurrentAuthentication.getAuthenticatedUserThreadLocal();
// }
//
// protected String getUserId()
// {
// String userId = null;
// if (getUserInfo() != null)
// {
// userId = getUserInfo().getUserId();
// }
// return userId;
// }
//
// protected String getCompanyId(ReginParams reginParams) {
// if (reginParams == null) {
// return null;
// }
// if (reginParams.getCompany() != null) {
// return reginParams.getCompany().getSequenceNbr().toString();
// }
// return null;
// }
/**
* 获取请求的cookies
* @return
*/
protected
HashMap
<
String
,
String
>
getCookInfoMap
(){
HashMap
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
Cookie
[]
cookies
=
request
.
getCookies
();
if
(
cookies
!=
null
){
for
(
Cookie
ck:
cookies
){
map
.
put
(
ck
.
getName
(),
ck
.
getValue
());
}
}
return
map
;
}
/**
* 获取公司orgcode
* @return
*/
// /**
// * 获取当前用户所属公司名称
// * @return
// */
// protected String getCurrentCompanyNameOfUser() {
// if (getUserInfo() == null) {
// return "";
// }
// return getSelectedOrgInfo().getCompany().getCompanyName();
// }
protected
String
getCompanyName
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getCompanyName
();
}
return
null
;
}
protected
String
getDepartmentId
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
if
(
reginParams
.
getDepartment
()
!=
null
)
{
return
reginParams
.
getDepartment
().
getSequenceNbr
().
toString
();
}
return
null
;
}
protected
String
getOrgCode
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
return
null
;
}
// /**
// * 获取请求的cookies
// * @return
// */
// protected HashMap<String,String> getCookInfoMap(){
// HashMap<String,String> map = new HashMap<String,String>();
// Cookie[] cookies = request.getCookies();
// if(cookies!=null){
// for(Cookie ck:cookies){
// map.put(ck.getName(), ck.getValue());
// }
// }
// return map;
// }
// /**
// * 获取公司orgcode
// * @return
// */
//
//
// protected String getCompanyName(ReginParams reginParams) {
// if (reginParams == null) {
// return null;
// }
// if (reginParams.getCompany() != null) {
// return reginParams.getCompany().getCompanyName();
// }
// return null;
// }
// protected String getDepartmentId(ReginParams reginParams) {
// if (reginParams == null) {
// return null;
// }
// if (reginParams.getDepartment() != null) {
// return reginParams.getDepartment().getDeptOrgCode();
// return reginParams.getDepartment().getSequenceNbr().toString();
// }
// return null;
// }
//
// protected String getOrgCode(ReginParams reginParams) {
// if (reginParams == null) {
// return null;
// }
//// if (reginParams.getDepartment() != null) {
//// return reginParams.getDepartment().getDeptOrgCode();
//// }
// if (reginParams.getCompany() != null) {
// return reginParams.getCompany().getOrgCode();
// }
if
(
reginParams
.
getCompany
()
!=
null
)
{
return
reginParams
.
getCompany
().
getOrgCode
();
}
return
null
;
}
//
//
// return null;
// }
/**
* 生成查询条件
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/AccidentTypeController.java
View file @
27bc6c53
...
...
@@ -11,13 +11,13 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IAccidentTypeService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -42,7 +42,7 @@ public class AccidentTypeController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"事故类型查询"
,
notes
=
"事故类型查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskLevelPage
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
...
...
@@ -62,7 +62,7 @@ public class AccidentTypeController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"事故类型查询不分页"
,
notes
=
"事故类型查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskLevel
()
{
...
...
@@ -77,7 +77,7 @@ public class AccidentTypeController extends AbstractBaseController {
* @param param
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"事故类型新增及维护"
,
notes
=
"事故类型新增及维护"
)
@RequestMapping
(
value
=
"/editAccidentType"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"事故类型对象"
,
required
=
true
)
@RequestBody
AccidentType
param
)
{
...
...
@@ -105,7 +105,7 @@ public class AccidentTypeController extends AbstractBaseController {
* @param param
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除事故类型"
,
notes
=
"删除事故类型"
)
@RequestMapping
(
value
=
"/deleteAccidentTypeById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deletePlanById
(
@ApiParam
(
value
=
"事故类型ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/AlarmController.java
View file @
27bc6c53
...
...
@@ -13,7 +13,8 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IAlarmService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -37,7 +38,7 @@ public class AlarmController extends AbstractBaseController {
* @param queryRequests
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"报警信息查分页询"
,
notes
=
"报警信息查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryAlarmPage
(
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/BizMessageController.java
View file @
27bc6c53
...
...
@@ -12,7 +12,8 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.fas.business.param.MessageParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IBizMessageService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -30,7 +31,7 @@ public class BizMessageController extends AbstractBaseController{
@Autowired
IBizMessageService
iBizMessageService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询消息"
,
notes
=
"分页查询消息"
)
@RequestMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -48,7 +49,7 @@ public class BizMessageController extends AbstractBaseController{
return
CommonResponseUtil
.
success
(
iBizMessageService
.
queryForPage
(
StringUtils
.
trimToNull
(
time
),
StringUtils
.
trimToNull
(
type
),
StringUtils
.
trimToNull
(
title
),
StringUtils
.
trimToNull
(
compCode
),
commonPageable
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询消息"
,
notes
=
"分页查询消息"
)
@RequestMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
forPagePOST
(
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/CommonController.java
View file @
27bc6c53
...
...
@@ -17,16 +17,16 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.business.param.QueryParamUtil
;
import
com.yeejoin.amos.fas.business.service.intfc.ICommonService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -56,7 +56,7 @@ public class CommonController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前用户获取公司下部门信息"
,
notes
=
"根据当前用户获取公司下部门信息"
)
@RequestMapping
(
value
=
"/deptment/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getDeptments
()
{
...
...
@@ -108,7 +108,7 @@ public class CommonController extends AbstractBaseController {
* @param
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询巡检点信息"
,
notes
=
"查询巡检点信息"
)
@PostMapping
(
value
=
"/pointList"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getPoints
(
...
...
@@ -133,7 +133,7 @@ public class CommonController extends AbstractBaseController {
* @return
*/
//@Authorization(ingore = true)
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询巡检点项信息"
,
notes
=
"查询巡检点项信息"
)
@PostMapping
(
value
=
"/pointInputlist"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getPointInputs
(
...
...
@@ -157,7 +157,7 @@ public class CommonController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据部门获取部门人员信息"
,
notes
=
"根据部门获取部门人员信息"
)
@RequestMapping
(
value
=
"/{departmentId}/user/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getUsers
(
@ApiParam
(
value
=
"部门ID"
,
required
=
true
)
@PathVariable
String
departmentId
)
{
...
...
@@ -168,7 +168,7 @@ public class CommonController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
users
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取公司下人员列表"
,
notes
=
"获取公司下人员列表"
)
@GetMapping
(
value
=
"/user/list"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getAllUser
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
27bc6c53
...
...
@@ -25,7 +25,8 @@ import com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanResponseVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.exception.YeeException
;
...
...
@@ -46,7 +47,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 创建数字预案
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"创建数字预案"
,
notes
=
"创建数字预案"
)
@PostMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
createPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
...
...
@@ -62,7 +63,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 修改数字预案
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"修改数字预案"
,
notes
=
"修改数字预案"
)
@PutMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
editPlan
(
@RequestBody
PlanDetailVo
planDetail
)
{
...
...
@@ -78,7 +79,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 查看数字预案详情
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查看数字预案详情"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
createPlan
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
...
...
@@ -91,7 +92,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 数字预案分页查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"数字预案分页查询"
,
notes
=
"数字预案分页查询"
)
@GetMapping
(
value
=
"/page"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
pageFilter
(
@RequestParam
(
value
=
"current"
)
int
current
,
...
...
@@ -114,7 +115,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 启用预案
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"启用预案"
,
notes
=
"启用预案"
)
@PutMapping
(
value
=
"/activate"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
activatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
...
...
@@ -127,7 +128,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 停用预案
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"停用预案"
,
notes
=
"停用预案"
)
@PutMapping
(
value
=
"/deactivate"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
deactivatePlan
(
@RequestBody
List
<
Long
>
idList
)
{
...
...
@@ -141,7 +142,7 @@ public class ContingencyPlanController extends AbstractBaseController {
/**
* 删除预案
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除预案"
,
notes
=
"删除预案"
)
@DeleteMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
deletePlan
(
@PathVariable
(
value
=
"ids"
)
String
idStr
)
{
...
...
@@ -158,7 +159,7 @@ public class ContingencyPlanController extends AbstractBaseController {
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
delete
(
idList
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取数字预案绑定的资源Id"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/bind-source/{type}"
,
produces
=
"application/json;charset=UTF-8"
)
public
ResponseModel
getPlanBindSource
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/CurCompanyController.java
View file @
27bc6c53
...
...
@@ -7,7 +7,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -19,7 +20,7 @@ import io.swagger.annotations.ApiOperation;
@Api
(
"获取当前用户信息api"
)
public
class
CurCompanyController
extends
AbstractBaseController
{
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取当前用户信息"
,
notes
=
"获取当前用户信息"
)
@RequestMapping
(
value
=
"/current"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
current
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/DataRefreshController.java
View file @
27bc6c53
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -25,7 +26,7 @@ public class DataRefreshController extends AbstractBaseController{
* 全景监控执行数据刷新
* @return success
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"全景监控执行数据刷新"
,
notes
=
"check-巡检记录,planTask-执行数据"
)
@GetMapping
(
value
=
"refresh/{dataType}"
)
public
CommonResponse
checkDataRefresh
(
@PathVariable
String
dataType
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/DictController.java
View file @
27bc6c53
...
...
@@ -12,7 +12,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -35,7 +36,7 @@ public class DictController extends AbstractBaseController{
* 根据查询条件列出字典列表
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据查询条件列出字典列表"
,
notes
=
"根据查询条件列出字典列表"
)
@RequestMapping
(
value
=
"/dict/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
//@Authorization(ingore=true)
...
...
@@ -54,7 +55,7 @@ public class DictController extends AbstractBaseController{
* 根据查询条件列出字典列表
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据查询条件列出字典列表"
,
notes
=
"根据查询条件列出字典列表"
)
@RequestMapping
(
value
=
"/dict/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
//@Authorization(ingore=true)
...
...
@@ -72,7 +73,7 @@ public class DictController extends AbstractBaseController{
* 根据IDs查询字典详情
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据IDs查询字典详情"
,
notes
=
"根据IDs查询字典详情"
)
@RequestMapping
(
value
=
"/dict/list/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
//@Authorization(ingore=true)
...
...
@@ -85,7 +86,7 @@ public class DictController extends AbstractBaseController{
* 根据ID查询字典详情
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据ID查询字典详情"
,
notes
=
"根据ID查询字典详情"
)
@RequestMapping
(
value
=
"/dict/list/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
//@Authorization(ingore=true)
...
...
@@ -99,7 +100,7 @@ public class DictController extends AbstractBaseController{
* 根据ID删除字典
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据ID删除字典"
,
notes
=
"根据ID删除字典"
)
@RequestMapping
(
value
=
"/dict/delete/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
//@Authorization(ingore=true)
...
...
@@ -112,7 +113,7 @@ public class DictController extends AbstractBaseController{
* 根据IDs删除字典
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据IDs删除字典"
,
notes
=
"根据IDs删除字典"
)
@RequestMapping
(
value
=
"/dict/delete/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
//@Authorization(ingore=true)
...
...
@@ -125,7 +126,7 @@ public class DictController extends AbstractBaseController{
* 新增字典
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增字典"
,
notes
=
"新增字典"
)
@RequestMapping
(
value
=
"/dict/add"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
//@Authorization(ingore=true)
...
...
@@ -138,7 +139,7 @@ public class DictController extends AbstractBaseController{
* 编辑字典信息
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑字典信息"
,
notes
=
"编辑字典信息"
)
@RequestMapping
(
value
=
"/dict/edit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
//@Authorization(ingore=true)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentController.java
View file @
27bc6c53
...
...
@@ -22,7 +22,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.fas.business.param.ImgParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.util.ExcelUtils
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -47,7 +48,7 @@ public class EquipmentController extends AbstractBaseController {
@Autowired
private
IEquipmentService
iEquipService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加重点设备"
,
notes
=
"添加重点设备"
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
create
(
@RequestBody
Equipment
equipment
)
throws
Exception
{
...
...
@@ -61,7 +62,7 @@ public class EquipmentController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
save
(
equipment
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑重点设备"
,
notes
=
"编辑重点设备"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
udpate
(
@PathVariable
Long
id
,
@RequestBody
Equipment
equipment
)
{
...
...
@@ -69,7 +70,7 @@ public class EquipmentController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
save
(
equipment
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单个重点设备"
,
notes
=
"查询单个重点设备"
)
@RequestMapping
(
value
=
"/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
query
(
@PathVariable
Long
id
)
{
...
...
@@ -77,7 +78,7 @@ public class EquipmentController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
queryOne
(
id
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除重点设备"
,
notes
=
"查询单个重点设备"
)
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
delete
(
@PathVariable
String
ids
)
throws
Exception
{
...
...
@@ -89,7 +90,7 @@ public class EquipmentController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
delete
(
idArray
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"重点设备查询"
,
notes
=
"重点设备查询"
)
@RequestMapping
(
value
=
"/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryImpEquipPage
(
...
...
@@ -108,7 +109,7 @@ public class EquipmentController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"现场图查询"
,
notes
=
"现场图查询"
)
@RequestMapping
(
value
=
"/pre-picture"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -135,7 +136,7 @@ public class EquipmentController extends AbstractBaseController {
* 保护对象查询查询,不分页
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"保护对象查询不分页"
,
notes
=
"保护对象查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryImpEquipNoPage
()
{
...
...
@@ -151,7 +152,7 @@ public class EquipmentController extends AbstractBaseController {
* @return
* @throws Exception
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"绑定消防设备"
,
notes
=
"绑定消防设备"
)
@RequestMapping
(
value
=
"/{id}/fireeqmt"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -167,7 +168,7 @@ public class EquipmentController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"解除绑定消防设备"
,
notes
=
"解除绑定消防设备"
)
@RequestMapping
(
value
=
"/{equipmentId}/fireeqmt/{fireEquipmentIds}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
...
...
@@ -186,7 +187,7 @@ public class EquipmentController extends AbstractBaseController {
* @param equipmentId
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定重点设备已经绑定的消防设备"
,
notes
=
"查询指定重点设备已经绑定的消防设备"
)
@RequestMapping
(
value
=
"/{equipmentId}/fireeqmt/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryBindFirEqumtList
(
...
...
@@ -201,7 +202,7 @@ public class EquipmentController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
queryBindFirEqumtList
(
commonPageable
,
equipmentId
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询有预案的重点设备分页"
,
notes
=
"查询有预案的重点设备分页"
)
@RequestMapping
(
value
=
"/reservePage"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
reservePage
(
...
...
@@ -228,7 +229,7 @@ public class EquipmentController extends AbstractBaseController {
* @param img4 消防取水图
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"编辑装备及上传现场图"
,
notes
=
"编辑装备及上传现场图"
)
@RequestMapping
(
value
=
"/uploadEquipmentImg"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -272,7 +273,7 @@ public class EquipmentController extends AbstractBaseController {
* 查询指定重点设备已经绑定的消防设备
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定重点设备已经绑定的消防设备"
,
notes
=
"查询指定重点设备已经绑定的消防设备"
)
@GetMapping
(
value
=
"/videos"
,
produces
=
"application/json;charset=UTF-8"
)
...
...
@@ -286,7 +287,7 @@ public class EquipmentController extends AbstractBaseController {
* @param equipmentId
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点装备详情"
,
notes
=
"重点装备详情"
)
@GetMapping
(
value
=
"/detail/{equipmentId}"
,
produces
=
"application/json;charset=UTF-8"
)
...
...
@@ -298,7 +299,7 @@ public class EquipmentController extends AbstractBaseController {
* 获取所有重点装备
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取所有重点装备无分页"
,
notes
=
"获取所有重点装备无分页"
)
@GetMapping
(
value
=
"/all"
,
produces
=
"application/json;charset=UTF-8"
)
...
...
@@ -326,7 +327,7 @@ public class EquipmentController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取设备数据"
,
notes
=
"获取设备数据"
)
@RequestMapping
(
value
=
"/queryEquipmentDate/{code}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -339,7 +340,7 @@ public class EquipmentController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/downTemplate"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"下载模板"
,
notes
=
"下载模板"
)
public
void
downTemplate
(
HttpServletResponse
response
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentSpecificIndexController.java
View file @
27bc6c53
...
...
@@ -9,7 +9,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -43,7 +44,7 @@ public class EquipmentSpecificIndexController extends AbstractBaseController {
@Autowired
private
EquipmentSpecificIndexService
equipmentSpecificIndexService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取最新告警状态"
,
notes
=
"获取最新告警状态"
)
@RequestMapping
(
value
=
"/queryInitAlarm"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryInitAlerm
(
@ApiParam
(
value
=
"物联采集属性值"
,
required
=
true
)
@RequestParam
String
value
,
...
...
@@ -53,7 +54,7 @@ public class EquipmentSpecificIndexController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
equipmentSpecificIndexService
.
queryInitAlarm
(
value
,
nameKeys
,
status
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取三维初始化告警信息"
,
notes
=
"获取三维初始化告警信息"
)
@RequestMapping
(
value
=
"/getInitAlarm"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getInitAlarm
(
@ApiParam
(
value
=
"物联采集属性值"
)
@RequestParam
(
required
=
false
)
String
value
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/EvaModelController.java
View file @
27bc6c53
...
...
@@ -9,7 +9,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IEvaModelService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -29,7 +30,7 @@ public class EvaModelController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"fmea评价模型查询"
,
notes
=
"fmea评价模型查询"
)
@RequestMapping
(
value
=
"/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryEvaModel
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/ExcelController.java
View file @
27bc6c53
...
...
@@ -25,7 +25,8 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam;
import
com.yeejoin.amos.fas.business.param.WaterResourceParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.util.FileHelper
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.exception.YeeException
;
...
...
@@ -44,7 +45,7 @@ public class ExcelController extends AbstractBaseController {
@Autowired
private
IExcelService
iExcelService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导入消防装备数据"
,
notes
=
"导入消防装备数据"
)
@PostMapping
(
value
=
"/import/fireEquipment"
)
public
CommonResponse
importFireEquipment
(
@RequestPart
(
"file"
)
MultipartFile
file
)
{
...
...
@@ -63,7 +64,7 @@ public class ExcelController extends AbstractBaseController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导入装备监测点数据"
,
notes
=
"导入装备监测点数据"
)
@PostMapping
(
value
=
"/import/fireEquipmentPoint"
)
public
CommonResponse
importFireEquipmentPoint
(
@RequestPart
(
"file"
)
MultipartFile
file
)
{
...
...
@@ -84,7 +85,7 @@ public class ExcelController extends AbstractBaseController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出数据"
,
notes
=
"导出数据"
)
@PostMapping
(
value
=
"/export"
)
//@Authorization(ingore = true)
...
...
@@ -119,7 +120,7 @@ public class ExcelController extends AbstractBaseController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导入数据"
,
notes
=
"导入数据"
)
@PostMapping
(
value
=
"/import/data/excel/{type}"
)
public
CommonResponse
importExcelData
(
@RequestPart
(
"file"
)
MultipartFile
file
,
@ApiParam
(
value
=
"导入资源类型"
,
required
=
true
)
@PathVariable
String
type
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/FileController.java
View file @
27bc6c53
...
...
@@ -33,7 +33,8 @@ import org.springframework.web.multipart.MultipartFile;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.DocUtil
;
...
...
@@ -71,7 +72,7 @@ public class FileController extends AbstractBaseController {
private
IPlanVisual3dService
iMaasVisualService
;
//文件上传
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/uploadfile"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
uploadfile
(
@RequestPart
(
"file"
)
MultipartFile
file
)
{
String
contentType
=
file
.
getContentType
();
//图片文件类型
...
...
@@ -79,15 +80,15 @@ public class FileController extends AbstractBaseController {
try
{
//调用文件处理类FileUtil,处理文件,将文件写入指定位置
FileUtil
.
uploadFile
(
file
.
getBytes
(),
fileUploadDir
,
fileName
);
return
new
CommonResponse
(
SUCCESS
,
fileName
);
return
new
CommonResponse
(
"SUCCESS"
,
fileName
);
}
catch
(
Exception
e
)
{
return
new
CommonResponse
(
FAILED
,
"上传失败"
);
return
new
CommonResponse
(
"FAILED"
,
"上传失败"
);
}
}
// 文件删除
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/deleteFile"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteFile
(
@RequestBody
String
path
)
{
try
{
...
...
@@ -96,24 +97,24 @@ public class FileController extends AbstractBaseController {
if
(
file
.
exists
())
{
if
(
file
.
delete
())
{
return
new
CommonResponse
(
FAILED
,
"删除成功"
);
return
new
CommonResponse
(
"FAILED"
,
"删除成功"
);
}
else
{
return
new
CommonResponse
(
FAILED
,
"删除失败"
);
return
new
CommonResponse
(
"FAILED"
,
"删除失败"
);
}
}
else
{
return
new
CommonResponse
(
FAILED
,
"文件不存在"
);
return
new
CommonResponse
(
"FAILED"
,
"文件不存在"
);
}
}
catch
(
Exception
e
)
{
return
new
CommonResponse
(
FAILED
,
"删除异常"
);
return
new
CommonResponse
(
"FAILED"
,
"删除异常"
);
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/plan/{appId}/texts"
)
public
CommonResponse
uploadTextPlans
(
@PathVariable
(
"appId"
)
String
appId
,
MultipartFile
[]
files
)
{
CommonResponse
response
=
FileUtil
.
uploadFiles
(
fileUploadDir
,
files
);
if
(
null
!=
response
&&
response
.
getResult
().
equals
(
SUCCESS
))
{
if
(
null
!=
response
&&
response
.
getResult
().
equals
(
"SUCCESS"
))
{
Map
<
String
,
String
>
pathNameMap
=
(
Map
<
String
,
String
>)
response
.
getDataList
();
iMaasVisualService
.
uploadTextPlan
(
appId
,
pathNameMap
);
return
CommonResponseUtil
.
success
(
"上传成功"
);
...
...
@@ -127,7 +128,7 @@ public class FileController extends AbstractBaseController {
}
// 图片读取
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getFile"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
void
getFile
(
String
in
,
@RequestParam
(
name
=
"open"
,
required
=
false
)
String
open
,
...
...
@@ -146,7 +147,7 @@ public class FileController extends AbstractBaseController {
IOUtils
.
closeQuietly
(
fis
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/download/**"
,
method
=
RequestMethod
.
GET
)
public
void
download
(
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
try
{
...
...
@@ -165,7 +166,7 @@ public class FileController extends AbstractBaseController {
* @return
* @author nihuanshan
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除文件"
,
notes
=
"删除文件"
)
@RequestMapping
(
value
=
"/delFiles"
,
method
=
RequestMethod
.
DELETE
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
delFiles
(
@ApiParam
(
value
=
"删除文件"
,
required
=
true
)
@RequestParam
List
<
String
>
files
)
{
...
...
@@ -179,7 +180,7 @@ public class FileController extends AbstractBaseController {
}
}
}
return
new
CommonResponse
(
SUCCESS
,
"删除文件成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
"删除文件成功"
);
}
/**
...
...
@@ -187,7 +188,7 @@ public class FileController extends AbstractBaseController {
* @author: nihuanshan
* @date: 2018年11月30日 下午3:15:38
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/lookHtmlText"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"查看文件内容"
,
notes
=
"查看文件内容"
)
public
CommonResponse
lookHtmlText
(
@ApiParam
(
value
=
"查看文件内容"
,
required
=
true
)
@RequestBody
String
file
)
...
...
@@ -199,11 +200,11 @@ public class FileController extends AbstractBaseController {
}
File
fi
=
new
File
(
fileName
);
if
(!
fi
.
exists
())
{
return
new
CommonResponse
(
SUCCESS
,
"访问的文件不存在!"
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
"访问的文件不存在!"
,
"查询成功"
);
}
if
(
fileName
.
endsWith
(
".pdf"
))
{
String
data
=
obj
.
getString
(
"file"
);
return
new
CommonResponse
(
SUCCESS
,
data
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
data
,
"查询成功"
);
}
else
if
(
fileName
.
endsWith
(
".doc"
)
||
fileName
.
endsWith
(
".docx"
))
{
String
htmlFileName
=
fileName
.
substring
(
0
,
fileName
.
indexOf
(
"."
))
+
".html"
;
File
htmlFile
=
new
File
(
htmlFileName
);
...
...
@@ -211,9 +212,9 @@ public class FileController extends AbstractBaseController {
FileInputStream
fis
=
new
FileInputStream
(
htmlFile
);
String
data
=
IOUtils
.
toString
(
fis
,
"utf-8"
);
// "gb2312"
fis
.
close
();
return
new
CommonResponse
(
SUCCESS
,
data
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
data
,
"查询成功"
);
}
else
{
return
new
CommonResponse
(
SUCCESS
,
"访问的文件不存在!"
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
"访问的文件不存在!"
,
"查询成功"
);
}
}
...
...
@@ -226,7 +227,7 @@ public class FileController extends AbstractBaseController {
* @return
* @throws Exception
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/lookHtmlTextNav"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"查看文件内容(加导航栏)"
,
notes
=
"查看文件内容(加导航栏)"
)
public
CommonResponse
lookHtmlTextNav
(
@ApiParam
(
value
=
"查看文件内容(加导航栏)"
,
required
=
true
)
@RequestBody
String
file
)
...
...
@@ -238,7 +239,7 @@ public class FileController extends AbstractBaseController {
}
File
fi
=
new
File
(
fileName
);
if
(!
fi
.
exists
())
{
return
new
CommonResponse
(
SUCCESS
,
"访问的文件不存在!"
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
"访问的文件不存在!"
,
"查询成功"
);
}
if
(
fileName
.
endsWith
(
".doc"
)
||
fileName
.
endsWith
(
".docx"
))
{
String
htmlFileName
=
fileName
.
substring
(
0
,
fileName
.
lastIndexOf
(
"."
))
+
".html"
;
...
...
@@ -264,16 +265,16 @@ public class FileController extends AbstractBaseController {
String
filePath
=
obj
.
getString
(
"file"
);
processData
.
put
(
"html"
,
"/"
+
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
"."
))
+
".html"
);
return
new
CommonResponse
(
SUCCESS
,
processData
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
processData
,
"查询成功"
);
}
if
(
fileName
.
endsWith
(
".pdf"
))
{
Map
<
String
,
Object
>
processData
=
new
HashMap
<
String
,
Object
>();
MyNode
node
=
PdfUtil
.
getPdfNavs
(
fileName
);
processData
.
put
(
"nodes"
,
node
.
getChildren
());
String
filePath
=
obj
.
getString
(
"file"
);
processData
.
put
(
"html"
,
"/"
+
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
"."
))
+
".pdf"
);
return
new
CommonResponse
(
SUCCESS
,
processData
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
processData
,
"查询成功"
);
}
else
{
return
new
CommonResponse
(
SUCCESS
,
"文件类型不为doc/docx"
,
"查询成功"
);
return
new
CommonResponse
(
"SUCCESS"
,
"文件类型不为doc/docx"
,
"查询成功"
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/FireEquimtPointController.java
View file @
27bc6c53
...
...
@@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.RestController;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -35,7 +36,7 @@ public class FireEquimtPointController extends AbstractBaseController {
@Autowired
private
IFireEquipPontService
fireEquipPontService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"指定消防设备的风险点列表"
,
notes
=
"指定消防设备的风险点列表"
)
@RequestMapping
(
value
=
"/fireequipment/{fireEqumtId}/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
pointList
(
@PathVariable
Long
fireEqumtId
,
...
...
@@ -47,7 +48,7 @@ public class FireEquimtPointController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
fireEquipPontService
.
queryByFireEquimt
(
fireEqumtId
,
name
,
commonPageable
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"指定消防设备的风险点列表"
,
notes
=
"指定消防设备的风险点列表"
)
@GetMapping
(
value
=
"/page"
)
public
CommonResponse
page
(
@ApiParam
(
value
=
"起始记录"
,
required
=
true
)
@RequestParam
Integer
pageNumber
,
...
...
@@ -69,7 +70,7 @@ public class FireEquimtPointController extends AbstractBaseController {
return
fireEquipPontService
.
queryByMap
(
queryMap
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"批量绑定"
,
notes
=
"批量绑定"
)
@GetMapping
(
value
=
"/batch/bindToEquipment"
)
public
CommonResponse
batchBindToEquipment
(
@ApiParam
(
value
=
"设备编号"
,
required
=
true
)
@RequestParam
Long
deviceId
,
...
...
@@ -81,7 +82,7 @@ public class FireEquimtPointController extends AbstractBaseController {
return
fireEquipPontService
.
batchBindToEquipment
(
deviceId
,
ids
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"批量解绑"
,
notes
=
"批量解绑"
)
@GetMapping
(
value
=
"/batch/unbindToEquipment"
)
public
CommonResponse
batchUnbindToEquipment
(
@ApiParam
(
value
=
"监测点编号(多个逗号隔开)"
,
required
=
true
)
@RequestParam
String
pointIds
)
{
...
...
@@ -92,7 +93,7 @@ public class FireEquimtPointController extends AbstractBaseController {
return
fireEquipPontService
.
batchUnbindToEquipment
(
ids
);
}
//
// @
Permission
// @
TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "添加监测点", notes = "添加监测点")
// @PostMapping(value = "/save")
// public CommonResponse save(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
...
...
@@ -106,7 +107,7 @@ public class FireEquimtPointController extends AbstractBaseController {
// return fireEquipPontService.save(fireEquipmentPointEntity);
// }
// @
Permission
// @
TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "修改监测点", notes = "修改监测点")
// @PostMapping(value = "/update")
// public CommonResponse update(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
...
...
@@ -122,7 +123,7 @@ public class FireEquimtPointController extends AbstractBaseController {
// return fireEquipPontService.update(fireEquipmentPointEntity);
// }
// @
Permission
// @
TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "批量删除监测点", notes = "批量删除监测点")
// @GetMapping(value = "/batch/delete")
// public CommonResponse batchDelete(@ApiParam(value = "监测点编号(多个逗号隔开)", required = true) @RequestParam String pointIds) {
...
...
@@ -138,7 +139,7 @@ public class FireEquimtPointController extends AbstractBaseController {
// return fireEquipPontService.batchDelete(ids);
// }
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据设备类型查询设备"
,
notes
=
"批量删除监测点"
)
@GetMapping
(
value
=
"/listByType"
)
public
CommonResponse
listByType
(
@ApiParam
(
value
=
"装备分类:0-设备类;1-耗材类;2-视频监控;3-灭火器材"
)
@RequestParam
(
required
=
false
)
Integer
equipClassify
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/FireRectificationController.java
View file @
27bc6c53
...
...
@@ -2,7 +2,8 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.bo.FireParamBo
;
import
com.yeejoin.amos.fas.business.service.intfc.FireRectificationService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -32,7 +33,7 @@ public class FireRectificationController extends AbstractBaseController {
@Autowired
private
FireRectificationService
fireRectificationService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"按条件查询消防整改列表信息"
,
notes
=
"按条件查询消防整改列表信息"
)
@GetMapping
(
value
=
"/list"
)
public
CommonResponse
queryFireList
(
...
...
@@ -45,21 +46,21 @@ public class FireRectificationController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
fireRectificationService
.
queryFiresAndCount
(
nameLike
,
sDate
,
eDate
,
states
,
pageNum
,
pageSize
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单个单据详细数据"
,
notes
=
"获取单个单据详细数据"
)
@GetMapping
(
value
=
"/getMoreData"
)
public
CommonResponse
seleteOne
(
@RequestParam
(
value
=
"billNo"
)
String
billNo
){
return
CommonResponseUtil
.
success
(
fireRectificationService
.
selectOneById
(
billNo
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"下载附件"
,
notes
=
"下载附件"
)
@PostMapping
(
value
=
"/downLoad"
)
public
void
downLoad
(
@RequestBody
List
<
String
>
path
,
HttpServletResponse
response
){
fireRectificationService
.
downLoadFilesByUrll
(
path
.
get
(
0
),
response
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改表单数据"
,
notes
=
"修改表单数据"
)
@PostMapping
(
value
=
"/update"
)
public
CommonResponse
update
(
@RequestBody
FireParamBo
paramBo
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/FireSourceController.java
View file @
27bc6c53
...
...
@@ -21,7 +21,8 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipService
;
//import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -44,7 +45,7 @@ public class FireSourceController extends AbstractBaseController {
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
FireSourceController
.
class
);
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除消防装备"
,
notes
=
"查询单个消防装备"
)
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
delete
(
@PathVariable
String
ids
)
throws
Exception
{
...
...
@@ -60,7 +61,7 @@ public class FireSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询消防车"
,
notes
=
"查询消防车"
)
@RequestMapping
(
value
=
"/fire-car/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryFireCar
(
...
...
@@ -77,7 +78,7 @@ public class FireSourceController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防车"
,
notes
=
"查询消防车"
)
@RequestMapping
(
value
=
"/fire-car/det/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryFireCar
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@PathVariable
Long
id
)
{
...
...
@@ -90,7 +91,7 @@ public class FireSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"消防装备查询"
,
notes
=
"消防装备查询"
)
@RequestMapping
(
value
=
"/fire-equip/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryFireEquipment
(
...
...
@@ -106,7 +107,7 @@ public class FireSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"配套设备查询"
,
notes
=
"配套设备查询"
)
@RequestMapping
(
value
=
"/matching-equip/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryFireEquipmentByProId
(
...
...
@@ -122,7 +123,7 @@ public class FireSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生产区域查询"
,
notes
=
"生产区域查询"
)
@RequestMapping
(
value
=
"/fire-equip/area"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryProArea
()
{
...
...
@@ -131,7 +132,7 @@ public class FireSourceController extends AbstractBaseController {
}
// @Authorization(ingore = true)
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防设备历史数据"
,
notes
=
"查询消防设备历史数据"
)
@RequestMapping
(
value
=
"/data/history"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForFireEquipmentHistory
(
...
...
@@ -147,7 +148,7 @@ public class FireSourceController extends AbstractBaseController {
StringUtils
.
trimToNull
(
startTime
),
StringUtils
.
trimToNull
(
endTime
),
commonPageable
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防设备列表"
,
notes
=
"查询消防设备列表"
)
@RequestMapping
(
value
=
"/info/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForEquipmentList
(
...
...
@@ -162,7 +163,7 @@ public class FireSourceController extends AbstractBaseController {
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
equipClassify
),
commonPageable
,
StringUtils
.
trimToNull
(
bindStation
)));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"消防状态明细信息"
,
notes
=
"消防状态明细信息"
)
@RequestMapping
(
value
=
"/info/detail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForEquipmentList
(
@ApiParam
(
value
=
"设备名称"
,
required
=
true
)
@RequestParam
String
id
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
27bc6c53
...
...
@@ -25,7 +25,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
...
...
@@ -53,21 +54,21 @@ public class PlanVisual3dController extends AbstractBaseController {
@Autowired
HttpServletRequest
request
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"预案应用树"
,
notes
=
"预案应用树"
)
@GetMapping
(
value
=
"/plan/tree"
)
public
CommonResponse
getPlanTree
()
{
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getPlanTree
());
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据ID获取文字预案"
,
notes
=
"根据ID获取文字预案"
)
@GetMapping
(
value
=
"/plan/text/{id}"
)
public
CommonResponse
getTextPlanById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getTextPlanInfoById
(
id
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@RequestMapping
(
value
=
"/plan/text/downloadFile/{id}"
,
method
=
RequestMethod
.
GET
)
public
HttpServletResponse
download
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -116,7 +117,7 @@ public class PlanVisual3dController extends AbstractBaseController {
/**
* 资源设备信息查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资源查询"
,
notes
=
"资源查询"
)
//@Authorization(ingore = true)
@GetMapping
(
value
=
"/resource/{type}/list"
)
...
...
@@ -130,7 +131,7 @@ public class PlanVisual3dController extends AbstractBaseController {
* @param id
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@GetMapping
(
value
=
"/{type}/detail/{id}"
)
@ApiOperation
(
value
=
"数据项查询"
,
notes
=
"按照分类及id查询数据项"
)
...
...
@@ -141,14 +142,14 @@ public class PlanVisual3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
list
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"预案应用树"
,
notes
=
"预案应用树"
)
@GetMapping
(
value
=
"/plan/textPlanTree/{appId}"
)
public
CommonResponse
getPlanTree
(
@PathVariable
(
"appId"
)
String
appId
)
{
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getTextPlanBySubjectId
(
appId
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除预案文件"
,
notes
=
"删除预案文件"
)
@DeleteMapping
(
value
=
"/plan/textPlan/{id}"
)
public
CommonResponse
deleteTextPlanFile
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/RiskFactorController.java
View file @
27bc6c53
...
...
@@ -16,7 +16,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -39,7 +40,7 @@ public class RiskFactorController extends AbstractBaseController {
/**
* 危险因素分页查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素查询"
,
notes
=
"危险因素查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskFactorPage
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
...
...
@@ -53,7 +54,7 @@ public class RiskFactorController extends AbstractBaseController {
/**
* 危险因素查询,不分页
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"危险因素查询不分页"
,
notes
=
"危险因素查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskFactor
()
{
...
...
@@ -64,7 +65,7 @@ public class RiskFactorController extends AbstractBaseController {
/**
* 危险因素新增及维护
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素新增及维护"
,
notes
=
"危险因素新增及维护"
)
@RequestMapping
(
value
=
"/editRiskFactor"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"危险因素对象"
,
required
=
true
)
@RequestBody
RiskFactor
param
)
{
...
...
@@ -93,7 +94,7 @@ public class RiskFactorController extends AbstractBaseController {
/**
* 危险因素删除(支持批量)
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除危险因素"
,
notes
=
"删除危险因素"
)
@RequestMapping
(
value
=
"/deleteRiskFactorById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteRiskFactorById
(
@ApiParam
(
value
=
"危险因素ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/RiskLevelController.java
View file @
27bc6c53
...
...
@@ -19,7 +19,8 @@ import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.common.enums.ManageLevelEum
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -44,7 +45,7 @@ public class RiskLevelController extends AbstractBaseController {
/**
* 风险等级分页查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级查询"
,
notes
=
"风险等级查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskLevelPage
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
...
...
@@ -58,7 +59,7 @@ public class RiskLevelController extends AbstractBaseController {
/**
* 风险等级查询,不分页
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险等级查询不分页"
,
notes
=
"风险等级查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskLevel
(
@ApiParam
(
value
=
"模型id"
)
@RequestParam
(
required
=
false
)
Long
id
)
{
...
...
@@ -69,7 +70,7 @@ public class RiskLevelController extends AbstractBaseController {
/**
* 风险等级新增及维护
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级新增及维护"
,
notes
=
"风险等级新增及维护"
)
@RequestMapping
(
value
=
"/editRiskLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"风险等级对象"
,
required
=
true
)
@RequestBody
RiskLevel
param
)
{
...
...
@@ -96,7 +97,7 @@ public class RiskLevelController extends AbstractBaseController {
/**
* 风险等级删除(支持批量)
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除风险等级"
,
notes
=
"删除风险等级"
)
@RequestMapping
(
value
=
"/deleteRiskLevelById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deletePlanById
(
@ApiParam
(
value
=
"风险等级ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
...
...
@@ -109,7 +110,7 @@ public class RiskLevelController extends AbstractBaseController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风险管控级别查询"
,
notes
=
"风险管控级别查询"
)
@GetMapping
(
value
=
"/manageLevel/list"
)
public
CommonResponse
getManageLevelEumList
(){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
27bc6c53
...
...
@@ -24,7 +24,8 @@ import com.yeejoin.amos.fas.business.service.intfc.IFmeaService;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -54,7 +55,7 @@ public class RiskModelController extends AbstractBaseController {
@Autowired
private
IFmeaDao
iFmeaDao
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据父类编号获取子类风险点类型"
,
notes
=
"根据父类编号获取子类风险点类型"
)
@GetMapping
(
value
=
"/riskSource/getChildTypeByPid"
)
public
CommonResponse
getChildTypeByPid
(
@ApiParam
(
value
=
"风险模型对象"
,
required
=
true
)
@RequestParam
Long
riskSourceId
)
{
...
...
@@ -71,7 +72,7 @@ public class RiskModelController extends AbstractBaseController {
/**
* 风险模型新增及维护
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险模型新增及维护"
,
notes
=
"风险模型新增及维护"
)
@RequestMapping
(
value
=
"/riskSource/editRiskSource"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
editRiskSource
(
@ApiParam
(
value
=
"风险模型对象"
,
required
=
true
)
@RequestBody
RiskSource
param
)
{
...
...
@@ -129,12 +130,12 @@ public class RiskModelController extends AbstractBaseController {
/**
* 风险模型删除
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险模型删除"
,
notes
=
"风险模型删除"
)
@RequestMapping
(
value
=
"/riskSource/deleteRiskSource"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteRiskSource
(
@ApiParam
(
value
=
"风险模型id"
,
required
=
true
)
@RequestBody
Long
[]
riskSourceId
)
{
try
{
riskSourceService
.
deleteRiskSource
(
getAppKey
(),
getProduct
(),
getToken
(),
SUCCESS
,
riskSourceId
);
riskSourceService
.
deleteRiskSource
(
getAppKey
(),
getProduct
(),
getToken
(),
"SUCCESS"
,
riskSourceId
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -145,7 +146,7 @@ public class RiskModelController extends AbstractBaseController {
/**
* 风险点列表分页查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险点列表分页查询"
,
notes
=
"风险点列表分页查询"
)
@RequestMapping
(
value
=
"/riskSource/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskSourceByPage
(
...
...
@@ -159,7 +160,7 @@ public class RiskModelController extends AbstractBaseController {
/**
* Fmea模型新增及维护
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"Fmea模型新增及维护"
,
notes
=
"Fmea模型新增及维护"
)
@RequestMapping
(
value
=
"/fmea/editFmea"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
editFmea
(
@ApiParam
(
value
=
"Fmea模型对象"
,
required
=
true
)
@RequestBody
List
<
Fmea
>
params
)
{
...
...
@@ -191,7 +192,7 @@ public class RiskModelController extends AbstractBaseController {
/**
* Fmea模型删除
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"Fmea模型删除"
,
notes
=
"Fmea模型删除"
)
@RequestMapping
(
value
=
"/fmea/deleteFmea"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteFmea
(
@ApiParam
(
value
=
"Fmea模型id"
,
required
=
true
)
@RequestBody
RiskFmeaParam
param
)
{
...
...
@@ -212,7 +213,7 @@ public class RiskModelController extends AbstractBaseController {
/**
* Fmea列表分页查询
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"Fmea列表分页查询"
,
notes
=
"Fmea列表分页查询"
)
@RequestMapping
(
value
=
"/fmea/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryFmeaByPage
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
...
...
@@ -222,7 +223,7 @@ public class RiskModelController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
fmeaList
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"Fmea是否关联对象查询"
,
notes
=
"Fmea是否关联对象查询"
)
@GetMapping
(
value
=
"/fmea/{ids}/controlObjCount"
)
public
CommonResponse
queryFmeaControlObj
(
@ApiParam
(
value
=
"fmea ids"
)
@PathVariable
(
value
=
"ids"
,
required
=
true
)
String
[]
ids
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
27bc6c53
...
...
@@ -32,7 +32,8 @@ import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.fas.core.enums.ReserveEnum
;
...
...
@@ -57,7 +58,7 @@ public class RiskSourceController extends AbstractBaseController {
@Autowired
IRiskSourceService
riskSourceService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询风险点子项"
,
notes
=
"查询风险点子项"
)
@RequestMapping
(
value
=
"/children/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -65,7 +66,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryForRegion
());
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"三维图统计"
,
notes
=
"三维图统计"
)
@RequestMapping
(
value
=
"/collection3d"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -79,7 +80,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询风险点RPN统计"
,
notes
=
"查询风险点RPN统计"
)
@RequestMapping
(
value
=
"/rpn/list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRPNReport
()
{
...
...
@@ -92,7 +93,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险上升率"
,
notes
=
"风险上升率"
)
@RequestMapping
(
value
=
"/riseuprate"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForRiseUp
()
throws
Exception
{
...
...
@@ -105,7 +106,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"发生率严重度矩阵"
,
notes
=
"发生率严重度矩阵"
)
@RequestMapping
(
value
=
"/matrix"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForMatrix
()
throws
Exception
{
...
...
@@ -117,7 +118,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取风险点树型结构"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -128,7 +129,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
getRiskSourcesTree
(
riskSources
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"远程同步"
,
notes
=
"将本地 风险模型推送到远程同步"
)
@PutMapping
(
value
=
"/synToEquipManage"
)
public
CommonResponse
synToEquipManage
()
{
...
...
@@ -150,7 +151,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取区域树型结构"
,
notes
=
"获取区域树型结构"
)
@RequestMapping
(
value
=
"/regionTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -161,7 +162,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
getRegionTree
(
riskSources
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/query3DStatistics/{markerType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -185,7 +186,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
failure
(
"未定义类型"
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -197,7 +198,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceStatistics
(
treeRiskSources
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面设备统计"
,
notes
=
"统计级别为1的风险点下面设备统计"
)
@RequestMapping
(
value
=
"/equipStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -207,7 +208,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceEquipStatistics
(
treeRiskSources
,
true
,
0
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的巡检点统计"
,
notes
=
"统计级别为1的巡检点统计"
)
@RequestMapping
(
value
=
"/checkPointStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -327,7 +328,7 @@ public class RiskSourceController extends AbstractBaseController {
return
count
;
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
// @Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面设备统计"
,
notes
=
"统计级别为1的风险点下面设备统计"
)
@RequestMapping
(
value
=
"/equipStatistics/{type}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -553,7 +554,7 @@ public class RiskSourceController extends AbstractBaseController {
/**
* 根据风险点查询关联巡检点
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据风险点查询关联巡检点"
,
notes
=
"根据风险点查询关联巡检点"
)
@GetMapping
(
value
=
"/getBindPoints"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
listFmeaPointInputitem
(
@ApiParam
(
value
=
"fmeaId"
,
required
=
true
)
@RequestParam
Long
fmeaId
,
...
...
@@ -568,7 +569,7 @@ public class RiskSourceController extends AbstractBaseController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定风险点绑定关系"
,
notes
=
"查询指定风险点绑定关系"
)
@RequestMapping
(
value
=
"/{fmeaId}/fireequiment/relations"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryBoundRelation
(
@PathVariable
Long
fmeaId
,
...
...
@@ -577,14 +578,14 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
listFeamEquipmentPoint
(
fmeaId
,
pageNumber
,
pageSize
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"绑定巡检点检查项"
,
notes
=
"绑定巡检点检查项"
)
@PostMapping
(
value
=
"/bindFmea/pointInputitem"
)
public
CommonResponse
bindFmeaPointInputitem
(
@RequestBody
FmeaBindParam
pointInputitems
)
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
bindPointInputitem
(
pointInputitems
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"绑定消防设备指标"
,
notes
=
"绑定消防设备指标"
)
@PostMapping
(
value
=
"/bingFmea/equimentPoint"
)
public
CommonResponse
bindFmeaEquimentPoint
(
@RequestBody
FmeaBindParam
fmeaBindParam
)
{
...
...
@@ -592,7 +593,7 @@ public class RiskSourceController extends AbstractBaseController {
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询绑定关系设备"
,
notes
=
"查询绑定关系包含已绑定和未绑定"
)
@RequestMapping
(
value
=
"/fireequiment/relation/all"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRelationWithNoBound
(
...
...
@@ -606,7 +607,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryEquimentRelation
(
commonPageable
,
equimentId
,
fname
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询设备指标"
,
notes
=
"查询设备指标"
)
@GetMapping
(
value
=
"/listEquipmentPointById"
)
public
CommonResponse
listEquipmentPointById
(
@RequestParam
Long
fmeaId
,
...
...
@@ -616,7 +617,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
importantEquipId
,
equimentId
,
equipmentPointName
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传消防设备数据"
,
notes
=
"上传消防设备数据"
)
@RequestMapping
(
value
=
"/data/fireqeuiment"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postFireEqumentData
(
@RequestBody
FireEquimentDataRo
deviceData
)
throws
Exception
{
...
...
@@ -647,7 +648,7 @@ public class RiskSourceController extends AbstractBaseController {
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
// @Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检数据"
,
notes
=
"上传巡检数据"
)
@RequestMapping
(
value
=
"/data/patroldata"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -667,7 +668,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
();
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检任务数据"
,
notes
=
"上传巡检任务数据"
)
@RequestMapping
(
value
=
"/data/task"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postTaskData
(
@RequestBody
ProtalDataRo
taskData
)
throws
Exception
{
...
...
@@ -682,7 +683,7 @@ public class RiskSourceController extends AbstractBaseController {
* @return
* @throws Exception
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询风险点明细"
,
notes
=
"查询风险点明细"
)
@GetMapping
(
value
=
"/detailById/{id}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryRiskSourceDetailById
(
@PathVariable
Long
id
)
{
...
...
@@ -690,7 +691,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
det
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风险预警详情"
,
notes
=
"风险预警详情"
)
@GetMapping
(
value
=
"/warning/detail"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
earlyWarning
(
@RequestParam
String
riskSourceId
)
{
...
...
@@ -701,7 +702,7 @@ public class RiskSourceController extends AbstractBaseController {
/**
* 获取厂区下所有区域的风险点的rpn值
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取厂区下所有区域的风险点的rpn值"
,
notes
=
"获取厂区下所有区域的风险点的rpn值"
)
@RequestMapping
(
value
=
"/queryRiskAreaRpn"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskAreaRpn
()
{
...
...
@@ -713,7 +714,7 @@ public class RiskSourceController extends AbstractBaseController {
/**
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设置预案节点自动执行"
,
notes
=
"设置预案节点自动执行"
)
@RequestMapping
(
value
=
"/contingency/setup"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskSourceSecondLevel
(
@RequestBody
ContingencyDeviceStatus
contingencyDeviceStatus
)
{
...
...
@@ -721,7 +722,7 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
();
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"初始化預案水資源"
,
notes
=
"初始化預案水資源"
)
@RequestMapping
(
value
=
"/contingency/water"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryContingencyWater
()
{
...
...
@@ -733,7 +734,7 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取危险因素树二级节点"
,
notes
=
"获取危险因素树二级节点"
)
@RequestMapping
(
value
=
"/riskSourceSecondLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceSecondLevel
()
{
...
...
@@ -747,14 +748,14 @@ public class RiskSourceController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取危险因素树二级节点"
,
notes
=
"获取危险因素树二级节点"
)
@RequestMapping
(
value
=
"/queryFmea/point/{pointId}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryFmeaByPointId
(
@PathVariable
Long
pointId
)
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryFmeaByPointId
(
pointId
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"同步风险区域"
,
notes
=
"创建或者更新,对站调用"
)
@PostMapping
(
"/syn/region"
)
public
CommonResponse
synRegion
(
@RequestBody
RiskSourceSynBo
synBo
){
...
...
@@ -763,14 +764,14 @@ public class RiskSourceController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
synRegion
(
getUserId
(),
compCode
,
synBo
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除建筑与风险区域关系"
,
notes
=
"对站调用"
)
@PutMapping
(
"/remove/bind"
)
public
CommonResponse
removeBind
(
@RequestParam
Long
instanceId
){
return
CommonResponseUtil
.
success
(
riskSourceService
.
removeBind
(
instanceId
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"物理区域修改同步到风险区域"
,
notes
=
"修改物理区域"
)
@PostMapping
(
"/syn/updateAreaSyn"
)
public
CommonResponse
updateAreaSyn
(
@RequestBody
RiskSourceSynBo
synBo
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/SafetyController.java
View file @
27bc6c53
...
...
@@ -42,7 +42,7 @@ public class SafetyController extends AbstractBaseController{
@ApiOperation
(
value
=
" 保存登陆用户选择公司信息"
,
notes
=
" 保存登陆用户选择公司信息"
)
@PostMapping
(
value
=
"/save/curCompany"
)
public
CommonResponse
saveCurCompany
(
@RequestBody
ReginParams
reginParams
)
{
this
.
saveSelectedOrgInfo
(
reginParams
);
//
this.saveSelectedOrgInfo(reginParams);
return
CommonResponseUtil
.
success
();
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/StationMaintenController.java
View file @
27bc6c53
...
...
@@ -9,7 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.service.intfc.IStationMaintenService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.StationInfo
;
...
...
@@ -29,7 +30,7 @@ public class StationMaintenController extends AbstractBaseController{
/**
* 保存站端信息
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存录入站端信息"
,
notes
=
"保存录入站端信息"
)
@PostMapping
(
value
=
"/save"
)
public
CommonResponse
saveStation
(
@RequestBody
StationInfo
stationParams
)
{
...
...
@@ -47,7 +48,7 @@ public class StationMaintenController extends AbstractBaseController{
/**
* 获取站端信息
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取站端信息"
,
notes
=
"获取站端信息"
)
@PostMapping
(
value
=
"/detail"
)
public
CommonResponse
detail
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/TimeLineController.java
View file @
27bc6c53
...
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.controller;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
...
...
@@ -12,7 +11,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -20,15 +18,16 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.business.action.CustomerAction
;
import
com.yeejoin.amos.fas.business.scheduled.FireScheduled
;
import
com.yeejoin.amos.fas.business.service.impl.RiskSourceServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRuleRunningSnapshotService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
import
com.yeejoin.amos.fas.core.enums.NumberEnum
;
...
...
@@ -60,15 +59,16 @@ public class TimeLineController extends AbstractBaseController{
@Autowired
IEquipmentService
equipmentService
;
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
@Autowired
FireScheduled
fireScheduled
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
IRuleRunningSnapshotService
ruleRunningSnapshotService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据批次号查询时间轴"
,
notes
=
"根据批次号查询时间轴"
)
@RequestMapping
(
value
=
"/{instanceNo}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -77,7 +77,7 @@ public class TimeLineController extends AbstractBaseController{
return
CommonResponseUtil
.
success
(
iContingencyInstance
.
queryForTimeLine
(
instanceNo
,
recordType
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/fire"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -97,11 +97,11 @@ public class TimeLineController extends AbstractBaseController{
map
.
put
(
"stepState"
,
stepState
);
map
.
put
(
"token"
,
getToken
());
map
.
put
(
"product"
,
getProduct
());
fireQueue
.
addLast
(
map
);
FireScheduled
.
getFireQueue
()
.
addLast
(
map
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/fire/exit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -126,7 +126,7 @@ public class TimeLineController extends AbstractBaseController{
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预案回放"
,
notes
=
"预案回放"
)
@RequestMapping
(
value
=
"/fire/replay"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
replay
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
...
...
@@ -135,7 +135,7 @@ public class TimeLineController extends AbstractBaseController{
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预案回放退出"
,
notes
=
"预案回放退出"
)
@RequestMapping
(
value
=
"/fire/replay/exit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
replayExit
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
...
...
@@ -144,43 +144,7 @@ public class TimeLineController extends AbstractBaseController{
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
@Scheduled
(
cron
=
"*/2 * * * * ?"
)
public
void
runFireQueue
()
throws
Exception
{
if
(
fireQueue
.
size
()
==
0
)
return
;
Map
<
String
,
String
>
map
=
fireQueue
.
getFirst
();
String
batchNo
=
map
.
get
(
"batchNo"
);
String
stepCode
=
map
.
get
(
"stepCode"
);
String
buttonCode
=
map
.
get
(
"buttonCode"
);
String
confirm
=
map
.
get
(
"confirm"
);
String
contingencyPlanId
=
map
.
get
(
"contingencyPlanId"
);
String
stepState
=
map
.
get
(
"stepState"
);
String
token
=
map
.
get
(
"token"
);
String
product
=
map
.
get
(
"product"
);
try
{
log
.
info
(
"fireQueue-size:"
+
fireQueue
.
size
());
log
.
info
(
"stepCode:"
+
map
.
get
(
"stepCode"
));
log
.
info
(
"buttonCode:"
+
map
.
get
(
"buttonCode"
));
log
.
info
(
"confirm:"
+
map
.
get
(
"confirm"
));
log
.
info
(
"stepState:"
+
map
.
get
(
"stepState"
));
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
iContingencyInstance
.
setButtonExecuted
(
batchNo
,
contingencyPlanId
,
buttonCode
,
confirm
);
iContingencyInstance
.
fire
(
batchNo
,
stepCode
,
contingencyPlanId
,
buttonCode
,
confirm
,
stepState
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
fireQueue
.
removeFirst
();
}
}
@Permission
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
// @Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询预案记录"
,
notes
=
"查询预案记录"
)
@RequestMapping
(
value
=
"/contingency/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -240,7 +204,7 @@ public class TimeLineController extends AbstractBaseController{
" ]"
+
"}"
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据批次号查询时间轴"
,
notes
=
"根据批次号查询时间轴"
)
@RequestMapping
(
value
=
"/replay"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryPoint
(
@RequestParam
(
"batchNo"
)
String
batchNo
)
throws
Exception
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/TopographyController.java
View file @
27bc6c53
...
...
@@ -18,7 +18,8 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.service.intfc.ITopographyLineService
;
import
com.yeejoin.amos.fas.business.service.intfc.ITopographyNodeService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.TopographyLine
;
...
...
@@ -40,7 +41,7 @@ public class TopographyController {
@Autowired
private
ITopographyLineService
lineService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据appId查询节点及线"
,
notes
=
"根据appID查询节点及线"
)
@GetMapping
(
value
=
"/query/{type}/{appId}"
)
public
CommonResponse
getTextPlanByIdAndType
(
@PathVariable
(
value
=
"appId"
)
String
appId
,
@PathVariable
(
value
=
"type"
)
String
type
)
{
...
...
@@ -52,7 +53,7 @@ public class TopographyController {
return
CommonResponseUtil
.
success
(
results
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据type查询节点及线"
,
notes
=
"根据type查询节点及线"
)
@GetMapping
(
value
=
"/query/{type}"
)
public
CommonResponse
getTextPlanByType
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
...
...
@@ -69,7 +70,7 @@ public class TopographyController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/updateTopo"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"保存拓扑图"
,
notes
=
"保存拓扑图"
)
public
CommonResponse
savedonghuanNodes
(
@ApiParam
(
value
=
""
,
required
=
false
)
@RequestBody
JSONObject
topographyParam
)
{
...
...
@@ -142,7 +143,7 @@ public class TopographyController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据nodeid查询节点详情"
,
notes
=
"根据nodeid查询节点详情"
)
@GetMapping
(
value
=
"/detail/{nodeid}"
)
public
CommonResponse
getNodeDatilByNodeId
(
@PathVariable
(
value
=
"nodeid"
)
String
nodeid
)
{
...
...
@@ -154,7 +155,7 @@ public class TopographyController {
return
CommonResponseUtil
.
success
();
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存节点详情"
,
notes
=
"保存节点详情"
)
@PostMapping
(
value
=
"/detail"
)
public
CommonResponse
saveNodeDatil
(
@RequestBody
TopographyNodeDetail
nodeDetail
)
{
...
...
@@ -166,7 +167,7 @@ public class TopographyController {
}
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除节点/线"
,
notes
=
"删除节点/线"
)
@DeleteMapping
(
value
=
"/{type}/{id}"
)
public
CommonResponse
deleteTopo
(
@PathVariable
(
"type"
)
String
type
,
@PathVariable
(
"id"
)
String
id
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
27bc6c53
...
...
@@ -26,7 +26,8 @@ import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -43,14 +44,14 @@ public class View3dController extends AbstractBaseController {
@Autowired
private
IView3dService
view3dService
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"点3d坐标设置"
,
notes
=
"按照点类型3d坐标设置"
)
@PostMapping
(
value
=
"/point/bind"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
setPoint3dPosition
(
@ApiParam
(
name
=
"参数"
,
required
=
true
)
@RequestBody
List
<
BindPointBo
>
pointBoList
){
return
view3dService
.
setPoint3dPosition
(
pointBoList
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"区域树查询"
,
notes
=
"区域树查询"
)
@GetMapping
(
value
=
"/region/tree"
)
public
CommonResponse
getRegionTree
()
{
...
...
@@ -60,7 +61,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
channelType
,
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"区域详情查询"
,
notes
=
"区域详情查询"
)
@GetMapping
(
value
=
"region/detail/{riskSourceId}"
)
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"riskSourceId"
)
Long
riskSourceId
)
{
...
...
@@ -70,7 +71,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
,
channelType
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"区域绑定"
,
notes
=
"区域绑定"
)
@PostMapping
(
value
=
"region/bind"
)
public
CommonResponse
batchSaveRegionUe4
(
@ApiParam
(
name
=
"区域参数列表"
,
required
=
true
)
@RequestBody
List
<
BindRegionBo
>
regionBoList
)
{
...
...
@@ -84,14 +85,14 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
();
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"点类型查询"
,
notes
=
"点类型查询"
)
@GetMapping
(
value
=
"point/type"
)
public
CommonResponse
getPointType
()
{
return
CommonResponseUtil
.
success
(
view3dService
.
getPointType
());
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"按照分类查询点树"
,
notes
=
"按照分类查询点树"
)
@GetMapping
(
value
=
"point/tree/{type}"
)
public
CommonResponse
getPointTreeByType
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
...
...
@@ -104,14 +105,14 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
failure
(
type
+
" 类型不存在"
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"按照不同类型查询点详情"
,
notes
=
"按照不同类型查询点详情"
)
@GetMapping
(
value
=
"point/detail"
)
public
CommonResponse
getPointDetail
(
@RequestParam
String
type
,
@RequestParam
Long
pointId
)
{
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"一周安全指数趋势查询"
,
notes
=
"一周安全指数趋势查询"
)
@GetMapping
(
value
=
"safetyIndex/week"
)
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
...
...
@@ -120,7 +121,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"今日安全指数查询"
,
notes
=
"按照日期查询安全指数及分类数据"
)
@GetMapping
(
value
=
"/statistics/safetyIndex"
)
public
CommonResponse
getSafetyIndexInfoByDate
(
@RequestParam
(
name
=
"date"
,
required
=
false
)
String
date
){
...
...
@@ -129,7 +130,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"今日安全指数详情"
,
notes
=
"今日安全指数详情"
)
@GetMapping
(
value
=
"/safetyIndex/detail/{type}"
)
public
CommonResponse
getSafetyIndexDetail
(
@ApiParam
(
value
=
"risk-风险异常,check-巡检异常,equip-设备故障"
)
@PathVariable
String
type
){
...
...
@@ -138,7 +139,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexDetail
(
type
,
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询上线的年日"
,
notes
=
"查询上线年日:10年101"
)
@GetMapping
(
value
=
"/online/date"
)
public
CommonResponse
getSystemOnlineDate
(){
...
...
@@ -148,7 +149,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSystemOnlineDate
(
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"今日巡检统计接口"
,
notes
=
"今日巡检统计接口"
)
@GetMapping
(
value
=
"statistics/check"
)
public
CommonResponse
getStatisticsCheck
(){
...
...
@@ -165,7 +166,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyExecuteListTop5
(
type
,
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"今日值班统计"
,
notes
=
"今日值班统计"
)
@GetMapping
(
value
=
"statistics/duty"
)
public
CommonResponse
getStatisticsDuty
(){
...
...
@@ -178,7 +179,7 @@ public class View3dController extends AbstractBaseController {
return
view3dService
.
getStatisticsDuty
(
getAppKey
(),
getProduct
(),
token
,
orgCode
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"异常区域信息查询"
,
notes
=
"异常区域信息查询"
)
@GetMapping
(
value
=
"region/exception/list"
)
public
CommonResponse
getExceptionRegion
(){
...
...
@@ -188,7 +189,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
exceptionRegionVoList
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"设备状态信息查询"
,
notes
=
"设备状态信息查询"
)
@GetMapping
(
value
=
"equipStatus/list"
)
public
CommonResponse
getEquipStatusList
(){
...
...
@@ -197,7 +198,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getEquipStatusList
(
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"3d视图点显示"
,
notes
=
"3d视图点显示"
)
@GetMapping
(
value
=
"initViewNode"
)
public
CommonResponse
initViewNode
(
String
type
,
Long
riskSourceId
){
...
...
@@ -206,7 +207,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
initViewErrorNode
(
type
,
riskSourceId
,
orgCode
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"按照点类型查询点列表"
,
notes
=
"按照点类型查询点列表"
)
@GetMapping
(
value
=
"point/list"
)
public
CommonResponse
get3dPointsByType
(
@RequestParam
(
required
=
false
,
defaultValue
=
"grain"
)
String
model
){
...
...
@@ -221,7 +222,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
();
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"安全指数日流生成"
,
notes
=
"安全指数日流生成定时任务"
)
@GetMapping
(
value
=
"safetyIndex/schJobTest"
)
public
CommonResponse
safetyIndexLog
(
@ApiParam
(
value
=
"格式:yyyy-MM-dd"
)
@RequestParam
String
runData
){
...
...
@@ -234,7 +235,7 @@ public class View3dController extends AbstractBaseController {
*
* @return
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"二级区域风险等级,风险值"
,
notes
=
"二级区域风险等级,风险值"
)
@RequestMapping
(
value
=
"/secondLevelRiskSource"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceSecondLevel
()
{
...
...
@@ -248,7 +249,7 @@ public class View3dController extends AbstractBaseController {
* 初始化三维视图节点
* </pre>
*/
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/init3dViewNode"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"初始化三维视图节点"
,
notes
=
"初始化三维视图节点"
)
public
CommonResponse
init3dViewNode
(
...
...
@@ -260,7 +261,7 @@ public class View3dController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
find3dViewDataByType
(
type
,
riskSourceId
,
orgCode
,
abnormalStatus
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/retrieve/all"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"右侧边栏搜索"
,
notes
=
"右侧边栏搜索"
)
public
CommonResponse
retrieveAll
(
...
...
@@ -283,7 +284,7 @@ public class View3dController extends AbstractBaseController {
token
,
appKey
,
product
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/retrieve3/all"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"右侧边栏搜索"
,
notes
=
"右侧边栏搜索"
)
public
CommonResponse
retrieve3All
(
...
...
@@ -307,14 +308,14 @@ public class View3dController extends AbstractBaseController {
token
,
appKey
,
product
);
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"等级查询"
,
notes
=
"等级查询"
)
@GetMapping
(
value
=
"point/level"
)
public
CommonResponse
pointLevel
(
@ApiParam
(
value
=
"点类型"
)
@RequestParam
String
type
){
return
CommonResponseUtil
.
success
(
view3dService
.
pointLevelList
(
type
));
}
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"重新区域下包含点"
,
notes
=
"重新区域下包含点"
)
@GetMapping
(
value
=
"point/list/{regionId}"
)
public
CommonResponse
listPointsByRegion
(
@PathVariable
Long
regionId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"all"
)
String
type
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/WeatherController.java
View file @
27bc6c53
...
...
@@ -13,7 +13,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.config.Permission
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -28,7 +29,7 @@ public class WeatherController extends AbstractBaseController {
@Value
(
"${param.weather.url}"
)
private
String
weatherUrl
;
@
Permission
@
TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"天气查询"
,
notes
=
"天气查询"
)
@GetMapping
(
"/{address}"
)
public
CommonResponse
getWeather
(
@PathVariable
(
"address"
)
String
address
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/scheduled/FireScheduled.java
0 → 100644
View file @
27bc6c53
package
com
.
yeejoin
.
amos
.
fas
.
business
.
scheduled
;
import
java.util.LinkedList
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
@Component
public
class
FireScheduled
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
FireScheduled
.
class
);
private
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
@Autowired
IContingencyInstance
iContingencyInstance
;
@Scheduled
(
cron
=
"*/2 * * * * ?"
)
public
void
runFireQueue
()
throws
Exception
{
if
(
fireQueue
.
size
()
==
0
)
return
;
Map
<
String
,
String
>
map
=
fireQueue
.
getFirst
();
String
batchNo
=
map
.
get
(
"batchNo"
);
String
stepCode
=
map
.
get
(
"stepCode"
);
String
buttonCode
=
map
.
get
(
"buttonCode"
);
String
confirm
=
map
.
get
(
"confirm"
);
String
contingencyPlanId
=
map
.
get
(
"contingencyPlanId"
);
String
stepState
=
map
.
get
(
"stepState"
);
// String token = map.get("token");
// String product = map.get("product");
try
{
log
.
info
(
"fireQueue-size:"
+
fireQueue
.
size
());
log
.
info
(
"stepCode:"
+
map
.
get
(
"stepCode"
));
log
.
info
(
"buttonCode:"
+
map
.
get
(
"buttonCode"
));
log
.
info
(
"confirm:"
+
map
.
get
(
"confirm"
));
log
.
info
(
"stepState:"
+
map
.
get
(
"stepState"
));
// RequestContext.setToken(token);
// RequestContext.setProduct(product);
iContingencyInstance
.
setButtonExecuted
(
batchNo
,
contingencyPlanId
,
buttonCode
,
confirm
);
iContingencyInstance
.
fire
(
batchNo
,
stepCode
,
contingencyPlanId
,
buttonCode
,
confirm
,
stepState
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
fireQueue
.
removeFirst
();
}
}
public
static
LinkedList
<
Map
<
String
,
String
>>
getFireQueue
()
{
return
fireQueue
;
}
public
static
void
setFireQueue
(
LinkedList
<
Map
<
String
,
String
>>
fireQueue
)
{
FireScheduled
.
fireQueue
=
fireQueue
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/config/Permission.java
View file @
27bc6c53
package
com
.
yeejoin
.
amos
.
fas
.
config
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
Permission
{
String
value
()
default
""
;
}
//
package com.yeejoin.amos.fas.config;
//
//
import java.lang.annotation.Documented;
//
import java.lang.annotation.ElementType;
//
import java.lang.annotation.Retention;
//
import java.lang.annotation.RetentionPolicy;
//
import java.lang.annotation.Target;
//
//
@Target(ElementType.METHOD)
//
@Retention(RetentionPolicy.RUNTIME)
//
@Documented
//
public @interface Permission {
//
String value() default "";
//
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/config/PermissionAspect.java
View file @
27bc6c53
package
com
.
yeejoin
.
amos
.
fas
.
config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.exception.PermissionException
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.Map
;
@Aspect
@Component
@ResponseBody
public
class
PermissionAspect
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
PermissionAspect
.
class
);
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
// 前置通知,在方法执行之前
@Before
(
value
=
"@annotation(Permission)"
)
public
void
PermissionCheck
(
JoinPoint
joinPoint
)
throws
PermissionException
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
logger
.
info
(
"======开始权限校验======"
);
// 用户token
String
token
=
(
String
)
request
.
getHeader
(
"token"
);
token
=
ObjectUtils
.
isEmpty
(
token
)
?
(
String
)
request
.
getHeader
(
"X-Access-Token"
)
:
token
;
String
product
=
(
String
)
request
.
getHeader
(
"product"
);
String
appKey
=
(
String
)
request
.
getHeader
(
"appKey"
);
logger
.
info
(
"用户token:"
+
token
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
if
(!
TokenOperation
.
refresh
(
token
))
{
throw
new
PermissionException
(
"登录信息失效,请重新登录"
);
}
if
(
joinPoint
.
getSignature
().
getName
().
equals
(
"saveCurCompany"
))
{
return
;
}
FeignClientResult
feignClientResult
;
AgencyUserModel
userModel
=
null
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
userModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
String
userId
=
null
;
ReginParams
regionParam
=
new
ReginParams
();
if
(
userModel
!=
null
){
userId
=
userModel
.
getUserId
();
ReginParams
reginParams
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
userModel
.
getUserId
(),
token
)),
ReginParams
.
class
);
if
(
reginParams
==
null
&&
userModel
.
getCompanys
().
size
()
>
0
){
CompanyModel
companyModel
=
userModel
.
getCompanys
().
get
(
0
);
List
<
DepartmentModel
>
deptList
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
token
,
product
,
appKey
,
companyModel
.
getSequenceNbr
().
toString
());
if
(
deptList
.
size
()
>
0
){
CompanyBo
companyBo
=
convertCompanyModelToBo
(
companyModel
);
DepartmentBo
departmentBo
=
convertDepartmentModelToBo
(
deptList
.
get
(
0
));
regionParam
.
setCompany
(
companyBo
);
regionParam
.
setDepartment
(
departmentBo
);
}
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
userModel
.
getOrgRoles
();
List
<
RoleModel
>
roleModels
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
orgRoles
))
{
for
(
Map
.
Entry
<
Long
,
List
<
RoleModel
>>
entry
:
orgRoles
.
entrySet
())
{
roleModels
=
entry
.
getValue
();
break
;
}
}
if
(!
ObjectUtils
.
isEmpty
(
roleModels
)){
regionParam
.
setRole
(
convertRoleModelToBo
(
roleModels
.
get
(
0
)));
}
redisTemplate
.
opsForValue
().
set
(
buildKey
(
userId
,
token
),
JSONObject
.
toJSONString
(
regionParam
));
}
}
}
catch
(
InnerInvokException
e
)
{
logger
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
}
private
DepartmentBo
convertDepartmentModelToBo
(
DepartmentModel
departmentModel
){
DepartmentBo
departmentBo
=
new
DepartmentBo
();
if
(
departmentModel
!=
null
)
{
departmentBo
.
setCompanySeq
(
departmentModel
.
getCompanySeq
());
departmentBo
.
setDepartmentDesc
(
departmentModel
.
getDepartmentDesc
());
departmentBo
.
setDepartmentName
(
departmentModel
.
getDepartmentName
());
departmentBo
.
setLevel
(
departmentModel
.
getLevel
());
departmentBo
.
setOrgCode
(
departmentModel
.
getOrgCode
());
departmentBo
.
setParentId
(
departmentModel
.
getParentId
());
departmentBo
.
setDeptOrgCode
(
departmentModel
.
getDeptOrgCode
());
departmentBo
.
setSequenceNbr
(
departmentModel
.
getSequenceNbr
());
}
return
departmentBo
;
}
/**
* Model 转 Bo
*/
private
CompanyBo
convertCompanyModelToBo
(
CompanyModel
companyModel
){
CompanyBo
companyBo
=
new
CompanyBo
();
if
(
companyModel
!=
null
)
{
companyBo
.
setAddress
(
companyModel
.
getAddress
());
companyBo
.
setCompanyName
(
companyModel
.
getCompanyName
());
companyBo
.
setCompanyOrgCode
(
companyModel
.
getCompanyOrgCode
());
companyBo
.
setEmail
(
companyModel
.
getEmail
());
companyBo
.
setLandlinePhone
(
companyModel
.
getLandlinePhone
());
companyBo
.
setLongitude
(
companyModel
.
getLongitude
());
companyBo
.
setLatitude
(
companyModel
.
getLatitude
());
companyBo
.
setLevel
(
companyModel
.
getLevel
());
companyBo
.
setOrgCode
(
companyModel
.
getOrgCode
());
companyBo
.
setSequenceNbr
(
companyModel
.
getSequenceNbr
());
companyBo
.
setParentId
(
companyModel
.
getParentId
());
}
return
companyBo
;
}
private
RoleBo
convertRoleModelToBo
(
RoleModel
roleModel
)
{
RoleBo
roleBo
=
new
RoleBo
();
if
(
roleModel
!=
null
){
roleBo
.
setRoleName
(
roleModel
.
getRoleName
());
roleBo
.
setRoleType
(
roleModel
.
getRoleType
());
roleBo
.
setSequenceNbr
(
roleModel
.
getSequenceNbr
());
}
return
roleBo
;
}
//redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
}
}
//
package com.yeejoin.amos.fas.config;
//
//
//
import com.alibaba.fastjson.JSON;
//
import com.alibaba.fastjson.JSONObject;
//
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
//
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
//
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
//
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
//
import com.yeejoin.amos.component.feign.config.InnerInvokException;
//
import com.yeejoin.amos.component.feign.config.TokenOperation;
//
import com.yeejoin.amos.component.feign.model.FeignClientResult;
//
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
//
//
import com.yeejoin.amos.fas.exception.PermissionException;
//
import com.yeejoin.amos.feign.privilege.Privilege;
//
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
//
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
//
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
//
import com.yeejoin.amos.feign.privilege.model.RoleModel;
//
import org.aspectj.lang.JoinPoint;
//
import org.aspectj.lang.annotation.Aspect;
//
import org.aspectj.lang.annotation.Before;
//
import org.slf4j.Logger;
//
import org.slf4j.LoggerFactory;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.data.redis.core.RedisTemplate;
//
import org.springframework.stereotype.Component;
//
import org.springframework.util.ObjectUtils;
//
import org.springframework.web.bind.annotation.ResponseBody;
//
import org.springframework.web.context.request.RequestContextHolder;
//
import org.springframework.web.context.request.ServletRequestAttributes;
//
import org.typroject.tyboot.core.foundation.context.RequestContext;
//
//
import javax.servlet.http.HttpServletRequest;
//
import java.util.List;
//
import java.util.Map;
//
//
@Aspect
//
@Component
//
@ResponseBody
//
public class PermissionAspect {
//
private static final Logger logger = LoggerFactory.getLogger(PermissionAspect.class);
//
//
@Autowired
//
private RedisTemplate<String, String> redisTemplate;
//
//
@Autowired
//
private RemoteSecurityService remoteSecurityService;
//
//
//
// 前置通知,在方法执行之前
//
@Before(value = "@annotation(Permission)")
//
public void PermissionCheck(JoinPoint joinPoint) throws PermissionException {
//
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
//
.getRequestAttributes()).getRequest();
//
//
logger.info("======开始权限校验======");
//
// 用户token
//
String token = (String) request.getHeader("token");
//
token = ObjectUtils.isEmpty(token) ? (String) request.getHeader("X-Access-Token") : token;
//
String product = (String) request.getHeader("product");
//
String appKey = (String) request.getHeader("appKey");
//
logger.info("用户token:" + token);
//
RequestContext.setToken(token);
//
RequestContext.setProduct(product);
//
RequestContext.setAppKey(appKey);
//
if (!TokenOperation.refresh(token)) {
//
throw new PermissionException("登录信息失效,请重新登录");
//
}
//
//
if (joinPoint.getSignature().getName().equals("saveCurCompany")) {
//
return;
//
}
//
FeignClientResult feignClientResult;
//
AgencyUserModel userModel=null;
//
try {
//
feignClientResult = Privilege.agencyUserClient.getme();
//
userModel = (AgencyUserModel) feignClientResult.getResult();
//
String userId = null;
//
ReginParams regionParam = new ReginParams();
//
if(userModel != null){
//
userId = userModel.getUserId();
//
ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
//
if(reginParams == null && userModel.getCompanys().size() > 0){
//
CompanyModel companyModel = userModel.getCompanys().get(0);
//
List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
//
if(deptList.size() > 0){
//
CompanyBo companyBo = convertCompanyModelToBo(companyModel);
//
DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
//
regionParam.setCompany(companyBo);
//
regionParam.setDepartment(departmentBo);
//
}
//
Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
//
List<RoleModel> roleModels = null;
//
if(!ObjectUtils.isEmpty(orgRoles)) {
//
for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
//
roleModels = entry.getValue();
//
break;
//
}
//
}
//
if(!ObjectUtils.isEmpty(roleModels)){
//
regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
//
}
//
redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
//
}
//
}
//
} catch (InnerInvokException e) {
//
logger.error(e.getMessage());
//
e.printStackTrace();
//
}
//
//
}
//
//
private DepartmentBo convertDepartmentModelToBo(DepartmentModel departmentModel){
//
DepartmentBo departmentBo = new DepartmentBo();
//
if(departmentModel != null) {
//
departmentBo.setCompanySeq(departmentModel.getCompanySeq());
//
departmentBo.setDepartmentDesc(departmentModel.getDepartmentDesc());
//
departmentBo.setDepartmentName(departmentModel.getDepartmentName());
//
departmentBo.setLevel(departmentModel.getLevel());
//
departmentBo.setOrgCode(departmentModel.getOrgCode());
//
departmentBo.setParentId(departmentModel.getParentId());
//
departmentBo.setDeptOrgCode(departmentModel.getDeptOrgCode());
//
departmentBo.setSequenceNbr(departmentModel.getSequenceNbr());
//
}
//
return departmentBo;
//
}
//
//
/**
//
* Model 转 Bo
//
*/
//
private CompanyBo convertCompanyModelToBo(CompanyModel companyModel){
//
//
CompanyBo companyBo = new CompanyBo();
//
if(companyModel != null) {
//
companyBo.setAddress(companyModel.getAddress());
//
companyBo.setCompanyName(companyModel.getCompanyName());
//
companyBo.setCompanyOrgCode(companyModel.getCompanyOrgCode());
//
companyBo.setEmail(companyModel.getEmail());
//
companyBo.setLandlinePhone(companyModel.getLandlinePhone());
//
companyBo.setLongitude(companyModel.getLongitude());
//
companyBo.setLatitude(companyModel.getLatitude());
//
companyBo.setLevel(companyModel.getLevel());
//
companyBo.setOrgCode(companyModel.getOrgCode());
//
companyBo.setSequenceNbr(companyModel.getSequenceNbr());
//
companyBo.setParentId(companyModel.getParentId());
//
}
//
return companyBo;
//
}
//
//
private RoleBo convertRoleModelToBo(RoleModel roleModel) {
//
RoleBo roleBo = new RoleBo();
//
if(roleModel != null){
//
roleBo.setRoleName(roleModel.getRoleName());
//
roleBo.setRoleType(roleModel.getRoleType());
//
roleBo.setSequenceNbr(roleModel.getSequenceNbr());
//
}
//
return roleBo;
//
}
//
//
//redi缓存选择的用户信息
//
private String buildKey(String userId, String token) {
//
return "region_" + userId + "_" + token;
//
//
}
//
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/InputItemController.java
View file @
27bc6c53
...
...
@@ -349,7 +349,7 @@ public class InputItemController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取维保项分类"
,
notes
=
"获取维保项分类"
)
@GetMapping
(
value
=
"/classify"
)
public
CommonResponse
getMaintenanceClassify
()
{
...
...
@@ -362,6 +362,7 @@ public class InputItemController extends AbstractBaseController {
* @return
* @Since 2021-3-10
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/downTemplate"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"下载模板"
,
notes
=
"下载模板"
)
public
void
downTemplate
(
HttpServletResponse
response
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/InputItemController.java
View file @
27bc6c53
...
...
@@ -351,7 +351,7 @@ public class InputItemController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取检查分类"
,
notes
=
"获取检查分类"
)
@GetMapping
(
value
=
"/checkClassify"
)
public
CommonResponse
getCheckClassify
()
{
...
...
amos-boot-system-fas/src/main/java/com/yeejoin/amos/
YeeAmosFireAutoSysStart
.java
→
amos-boot-system-fas/src/main/java/com/yeejoin/amos/
FireAutoSysApplication
.java
View file @
27bc6c53
...
...
@@ -55,9 +55,9 @@ import com.yeejoin.amos.fas.context.IotContext;
@EnableEurekaClient
@ComponentScan
({
"org.typroject"
,
"com.yeejoin.amos"
})
@MapperScan
(
basePackages
=
{
"com.yeejoin.amos.fas.business.dao.mapper"
,
"org.typroject.tyboot.*.*.face.orm.dao"
,
"com.yeejoin.amos.api.*.face.orm.dao"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
public
class
YeeAmosFireAutoSysStart
implements
ApplicationContextAware
{
public
class
FireAutoSysApplication
implements
ApplicationContextAware
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
YeeAmosFireAutoSysStart
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FireAutoSysApplication
.
class
);
/**
* 启动amosop-server
...
...
@@ -68,7 +68,7 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware {
*/
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
logger
.
info
(
"start Service.........."
);
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
YeeAmosFireAutoSysStart
.
class
,
args
);
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
FireAutoSysApplication
.
class
,
args
);
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
Environment
env
=
context
.
getEnvironment
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
...
...
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