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
8f6d1ed9
Commit
8f6d1ed9
authored
Dec 16, 2021
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改告警导出和集成后手机端接口调用问题
parent
a50bcd0b
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
173 additions
and
135 deletions
+173
-135
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+1
-1
BaseController.java
...ejoin/amos/boot/biz/common/controller/BaseController.java
+10
-0
pom.xml
...e/amos-boot-module-api/amos-boot-module-equip-api/pom.xml
+14
-0
GlobalExceptionHandler.java
...anage/common/exception/handle/GlobalExceptionHandler.java
+48
-48
DateUtils.java
.../java/com/yeejoin/equipmanage/common/utils/DateUtils.java
+1
-1
ExcelUtil.java
.../java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
+4
-4
ImportFile.java
...java/com/yeejoin/equipmanage/common/utils/ImportFile.java
+2
-1
EquipmentAlarmDownloadVO.java
...ejoin/equipmanage/common/vo/EquipmentAlarmDownloadVO.java
+12
-12
DownloadController.java
...om/yeejoin/equipmanage/controller/DownloadController.java
+9
-4
UserController.java
...va/com/yeejoin/equipmanage/controller/UserController.java
+49
-44
RemoteSecurityService.java
...com/yeejoin/equipmanage/remote/RemoteSecurityService.java
+1
-0
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+2
-2
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+8
-7
MainIotMonitorServiceImpl.java
...n/equipmanage/service/impl/MainIotMonitorServiceImpl.java
+2
-1
QREquipmentDefServiceImpl.java
...n/equipmanage/service/impl/QREquipmentDefServiceImpl.java
+2
-2
QREquipmentKnowledgeServiceImpl.java
...pmanage/service/impl/QREquipmentKnowledgeServiceImpl.java
+2
-3
StockBillDetailServiceImpl.java
.../equipmanage/service/impl/StockBillDetailServiceImpl.java
+2
-3
AmostEquipApplication.java
...quip/src/main/java/com/yeejoin/AmostEquipApplication.java
+3
-1
EquipmentMapper.xml
...ystem-equip/src/main/resources/mapper/EquipmentMapper.xml
+1
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
8f6d1ed9
...
...
@@ -66,7 +66,7 @@ public class ControllerAop {
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
// 不需要添加请求头的接口
String
[]
url
=
new
String
[]{
"/api/user/s
electInfo"
,
"/api/user/s
ave/curCompany"
,
"/jcs/command/lookHtmlText"
,
String
[]
url
=
new
String
[]{
"/api/user/save/curCompany"
,
"/jcs/command/lookHtmlText"
,
"/jcs/common/duty-person/findByDutyAreaId"
,
"/tzs/wechatBack"
,
"/tzs/elevator/getElevatorInfo"
};
// 获取请求路径
for
(
String
uri
:
url
)
{
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/controller/BaseController.java
View file @
8f6d1ed9
...
...
@@ -41,6 +41,16 @@ public class BaseController {
protected
ReginParams
getSelectedOrgInfo
()
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
}
/**
* 用户选择信息保存redis
*/
protected
void
saveSelectedOrgInfo
(
ReginParams
reginParams
)
{
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParams
));
}
protected
String
getOrgCode
(
ReginParams
reginParams
)
{
if
(
reginParams
==
null
)
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/pom.xml
View file @
8f6d1ed9
...
...
@@ -20,6 +20,20 @@
<groupId>
org.apache.tika
</groupId>
<artifactId>
tika-parsers
</artifactId>
<version>
1.17
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-scratchpad
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/exception/handle/GlobalExceptionHandler.java
View file @
8f6d1ed9
//
package com.yeejoin.equipmanage.common.exception.handle;
//
//
import org.slf4j.Logger;
//
import org.slf4j.LoggerFactory;
//
import org.springframework.http.HttpStatus;
//
import org.springframework.web.bind.annotation.ExceptionHandler;
//
import org.springframework.web.bind.annotation.RestControllerAdvice;
//
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.restful.utils.ResponseModel;
//
//
import javax.servlet.http.HttpServletRequest;
//
/
//
**
//
* @description: 全局异常处理器
//
* @author: duanwei
//
* @create: 2019-08-28 20:07
//
**/
//
@RestControllerAdvice
//
public class GlobalExceptionHandler {
//
//
private Logger log = LoggerFactory.getLogger(this.getClass());
//
//
public GlobalExceptionHandler() {
//
}
//
//
@ExceptionHandler({ Exception.class })
//
public ResponseModel<Object> MethodArgumentNotValidHandler(Exception exception) throws Exception {
//
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
//
.getRequest();
//
ResponseModel<Object> response = new ResponseModel<>();
//
//
//解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面
//
if(exception.getMessage()!=null&&exception.getMessage().indexOf("账号已经在其他设备登录")!=-1 ||exception.getMessage().indexOf("请重新登录")!=-1){
//
response.setStatus(HttpStatus.FORBIDDEN.value());
//
}else{
//
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
//
}
//
//
response.setDevMessage("FAILED");
//
response.setMessage( exception.getMessage());
//
response.setTraceId(RequestContext.getTraceId());
//
response.setPath(request.getServletPath());exception.printStackTrace();
//
return response;
//
}
//
//
}
package
com
.
yeejoin
.
equipmanage
.
common
.
exception
.
handle
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
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.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @description: 全局异常处理器
* @author: duanwei
* @create: 2019-08-28 20:07
**/
@RestControllerAdvice
public
class
GlobalExceptionHandler
{
private
Logger
log
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
public
GlobalExceptionHandler
()
{
}
@ExceptionHandler
({
Exception
.
class
})
public
ResponseModel
<
Object
>
MethodArgumentNotValidHandler
(
Exception
exception
)
throws
Exception
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
())
.
getRequest
();
ResponseModel
<
Object
>
response
=
new
ResponseModel
<>();
//解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面
if
(
exception
.
getMessage
()!=
null
&&
exception
.
getMessage
().
indexOf
(
"账号已经在其他设备登录"
)!=-
1
||
exception
.
getMessage
().
indexOf
(
"请重新登录"
)!=-
1
){
response
.
setStatus
(
HttpStatus
.
FORBIDDEN
.
value
());
}
else
{
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
}
response
.
setDevMessage
(
"FAILED"
);
response
.
setMessage
(
exception
.
getMessage
());
response
.
setTraceId
(
RequestContext
.
getTraceId
());
response
.
setPath
(
request
.
getServletPath
());
exception
.
printStackTrace
();
return
response
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/DateUtils.java
View file @
8f6d1ed9
...
...
@@ -136,7 +136,7 @@ public class DateUtils {
* @throws ParseException
*/
public
static
String
dateFormat
(
Date
date
,
String
pattern
)
throws
ParseException
{
if
(
StringUtils
.
is
Not
Empty
(
pattern
))
{
if
(
StringUtils
.
isEmpty
(
pattern
))
{
pattern
=
DateUtils
.
DATE_PATTERN
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
pattern
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
View file @
8f6d1ed9
...
...
@@ -354,10 +354,10 @@ public class ExcelUtil
style
.
setWrapText
(
true
);
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// 左右居中
style
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
style
.
setLeftBorderColor
(
HSSFColor
.
BLACK
.
index
);
// 左边框的颜色
style
.
setRightBorderColor
(
HSSFColor
.
BLACK
.
index
);
// 右边框的颜色
style
.
setBottomBorderColor
(
HSSFColor
.
BLACK
.
index
);
// 设置单元格的边框颜色
style
.
setFillForegroundColor
(
HSSFColor
.
WHITE
.
index
);
//
style.setLeftBorderColor(HSSFColor.BLACK.index);// 左边框的颜色
//
style.setRightBorderColor(HSSFColor.BLACK.index);// 右边框的颜色
//
style.setBottomBorderColor(HSSFColor.BLACK.index); // 设置单元格的边框颜色
//
style.setFillForegroundColor(HSSFColor.WHITE.index);
style
.
setBorderBottom
(
BorderStyle
.
THIN
);
style
.
setBorderLeft
(
BorderStyle
.
THIN
);
style
.
setBorderRight
(
BorderStyle
.
THIN
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/ImportFile.java
View file @
8f6d1ed9
...
...
@@ -7,6 +7,7 @@ import java.util.Set;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
...
...
@@ -41,7 +42,7 @@ public interface ImportFile {
Cell
cell
=
row
.
getCell
(
cellNum
);
if
(
cell
.
getCellType
()
==
HSSFCell
.
CELL_TYPE_
STRING
)
{
if
(
cell
.
getCellType
()
==
CellType
.
STRING
)
{
if
(
null
!=
cell
&&
StringUtil
.
isNotEmpty
(
cell
.
getStringCellValue
()))
{
ParsePropertyUtil
.
setting
(
value_1:
:
add
,
()
->
cell
.
getStringCellValue
());
ParsePropertyUtil
.
setting
(
value_2:
:
add
,
()
->
cell
.
getStringCellValue
());
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/EquipmentAlarmDownloadVO.java
View file @
8f6d1ed9
...
...
@@ -14,38 +14,38 @@ public class EquipmentAlarmDownloadVO implements Serializable {
@ExcelProperty
(
value
=
"告警类型"
,
index
=
0
)
private
String
alarmType
;
private
String
alarmType
=
""
;
@ExcelProperty
(
value
=
"告警设备"
,
index
=
1
)
private
String
equipName
;
private
String
equipName
=
""
;
@ExcelProperty
(
value
=
"告警内容"
,
index
=
2
)
private
String
alarmContent
;
private
String
alarmContent
=
""
;
@ExcelProperty
(
value
=
"设备编号"
,
index
=
3
)
private
String
equipCode
;
private
String
equipCode
=
""
;
@ExcelProperty
(
value
=
"告警位置"
,
index
=
4
)
private
String
alarmPosition
;
private
String
alarmPosition
=
""
;
@ExcelProperty
(
value
=
"保护对象"
,
index
=
5
)
private
String
protectObj
;
private
String
protectObj
=
""
;
@ExcelProperty
(
value
=
"告警时间"
,
index
=
6
)
private
String
alarmTime
;
private
String
alarmTime
=
""
;
@ExcelProperty
(
value
=
"处理状态"
,
index
=
7
)
private
String
handleStatus
;
private
String
handleStatus
=
""
;
@ExcelProperty
(
value
=
"处理类型"
,
index
=
8
)
private
String
handleType
;
private
String
handleType
=
""
;
@ExcelProperty
(
value
=
"处理时间"
,
index
=
9
)
private
String
confirmDate
;
private
String
confirmDate
=
""
;
@ExcelProperty
(
value
=
"报警原因"
,
index
=
10
)
private
String
alarmReason
;
private
String
alarmReason
=
""
;
@ExcelProperty
(
value
=
"处理情况"
,
index
=
11
)
private
String
resolveResult
;
private
String
resolveResult
=
""
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/DownloadController.java
View file @
8f6d1ed9
...
...
@@ -4,18 +4,23 @@ import java.util.Optional;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
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.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.equipmanage.common.entity.publics.CommonResponse
;
import
com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtil
;
import
com.yeejoin.equipmanage.common.utils.FileUploadTypeEnum
;
import
com.yeejoin.equipmanage.service.IDownloadFileService
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/UserController.java
View file @
8f6d1ed9
...
...
@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -44,11 +45,14 @@ import com.alibaba.fastjson.JSONObject;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
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.model.FeignClientResult
;
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
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.equipmanage.common.entity.publics.CommonResponse
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
...
...
@@ -509,7 +513,7 @@ public class UserController extends AbstractBaseController {
/**
* APP登录
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
,
needAuth
=
false
)
@ApiOperation
(
value
=
"APP登录"
,
notes
=
"APP登录"
)
@PostMapping
(
value
=
"/mobile/login"
)
public
ResponseModel
mobileLogin
(
@ApiParam
(
value
=
"账号"
,
required
=
true
)
@RequestBody
AppLoginUserParam
param
)
{
...
...
@@ -604,7 +608,8 @@ public class UserController extends AbstractBaseController {
}
}
Map
<
String
,
Object
>
mapRoles
=
objectToMap
(
user
.
getOrgRoles
());
result
.
put
(
"userModel"
,
user
);
result
.
put
(
"companys"
,
listCompanyModel
);
result
.
put
(
"orgRoles"
,
user
.
getOrgRoles
());
result
.
put
(
"companyDepartments"
,
mapdate
);
...
...
@@ -684,49 +689,49 @@ public class UserController extends AbstractBaseController {
/**
* 保存登陆用户选择公司信息
*/
//
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存登陆用户选择公司信息"
,
notes
=
"保存登陆用户选择公司信息"
)
//
@PostMapping(value = "/save/curCompany")
//
public JSONObject saveCurCompany(
//
@ApiParam(value = "当前登陆用户所选单位机构编号", required = true) @RequestBody SelectUserInfo selectUserInfo) {
//
try {
//
AgencyUserModel user = getUserInfo();
//
//
CompanyBo company = new CompanyBo();
//
DepartmentBo department = new DepartmentBo();
//
RoleBo role = new RoleBo();
//
if(ObjectUtils.isEmpty(selectUserInfo.getCompanyModel())){
//
CompanyModel companyM = user.getCompanys().get(0);
//
Bean.copyExistPropertis(companyM,company);
//
//
Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
//
DepartmentModel departmentM = mapDepartments.get(companyM.getSequenceNbr()).get(0);
//
Bean.copyExistPropertis(departmentM,department);
//
Map<Long, List<RoleModel>> roles = user.getOrgRoles();
//
RoleModel roleM = roles.get(departmentM.getSequenceNbr()).get(0);
//
//
Bean.copyExistPropertis(roleM,role);
//
selectUserInfo.setCompanyModel(company);
//
selectUserInfo.setDepartmentModel(department);
//
selectUserInfo.setRoleModel(role);
//
}else{
//
company = selectUserInfo.getCompanyModel();
//
role = selectUserInfo.getRoleModel();
//
department = selectUserInfo.getDepartmentModel();
//
}
//
ReginParams reginParams = new ReginParams();
// reginParams.setCompany(company
);
// reginParams.setRole(role
);
// reginParams.setDepartment(department
);
// saveSelectedOrgInfo(reginParams
);
//
//
return buildCurCompany(selectUserInfo, user);
//
} catch (Exception e) {
//
e.printStackTrace();
//
logger.error("保存登陆用户选择公司信息异常", e);
//
throw new RuntimeException("系统繁忙,请稍后再试");
//
}
//
}
@PostMapping
(
value
=
"/save/curCompany"
)
public
JSONObject
saveCurCompany
(
@ApiParam
(
value
=
"当前登陆用户所选单位机构编号"
,
required
=
true
)
@RequestBody
SelectUserInfo
selectUserInfo
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
CompanyBo
company
=
new
CompanyBo
();
DepartmentBo
department
=
new
DepartmentBo
();
RoleBo
role
=
new
RoleBo
();
if
(
ObjectUtils
.
isEmpty
(
selectUserInfo
.
getCompanyModel
())){
CompanyModel
companyM
=
user
.
getCompanys
().
get
(
0
);
Bean
.
copyExistPropertis
(
companyM
,
company
);
Map
<
Long
,
List
<
DepartmentModel
>>
mapDepartments
=
user
.
getCompanyDepartments
();
DepartmentModel
departmentM
=
mapDepartments
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
);
Bean
.
copyExistPropertis
(
departmentM
,
department
);
Map
<
Long
,
List
<
RoleModel
>>
roles
=
user
.
getOrgRoles
();
RoleModel
roleM
=
roles
.
get
(
departmentM
.
getSequenceNbr
()).
get
(
0
);
Bean
.
copyExistPropertis
(
roleM
,
role
);
selectUserInfo
.
setCompanyModel
(
company
);
selectUserInfo
.
setDepartmentModel
(
department
);
selectUserInfo
.
setRoleModel
(
role
);
}
else
{
company
=
selectUserInfo
.
getCompanyModel
();
role
=
selectUserInfo
.
getRoleModel
();
department
=
selectUserInfo
.
getDepartmentModel
();
}
ReginParams
reginParams
=
new
ReginParams
();
reginParams
.
setUserModel
(
user
);
reginParams
.
setCompany
(
company
);
reginParams
.
setRole
(
role
);
reginParams
.
setDepartment
(
department
);
saveSelectedOrgInfo
(
reginParams
);
return
buildCurCompany
(
selectUserInfo
,
user
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"保存登陆用户选择公司信息异常"
,
e
);
throw
new
RuntimeException
(
"系统繁忙,请稍后再试"
);
}
}
private
JSONObject
buildCurCompany
(
SelectUserInfo
selectUserInfo
,
AgencyUserModel
user
)
{
JSONObject
result
=
new
JSONObject
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/remote/RemoteSecurityService.java
View file @
8f6d1ed9
...
...
@@ -276,6 +276,7 @@ public class RemoteSecurityService {
dPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
RequestContext
.
setProduct
(
productApp
);
RequestContext
.
setAppKey
(
appKeyApp
);
feignClientResult
=
Privilege
.
authClient
.
idpassword
(
dPasswordAuthModel
);
Map
map
=
(
Map
)
feignClientResult
.
getResult
();
if
(
map
!=
null
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -43,6 +43,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.github.pagehelper.util.StringUtil
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -238,8 +239,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
// redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
return
RedisKey
.
buildReginKey
(
userId
,
token
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -7,6 +7,7 @@ import java.net.SocketException;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -25,6 +26,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
...
...
@@ -55,7 +57,6 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.utils.ExcelUtil
;
/**
* @author DELL
...
...
@@ -103,11 +104,11 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
throw
new
RuntimeException
(
"导出数据列表无数据!"
);
}
ExcelUtil
.
createTemplate
(
response
,
"设备告警信息"
,
"设备告警信息"
,
equipmentDownloads
,
EquipmentAlarmDownloadVO
.
class
,
null
,
null
,
null
,
false
);
false
);
}
public
List
<
EquipmentAlarmDownloadVO
>
handleExportData
(
List
<
Long
>
ids
,
List
<
HashMap
<
String
,
Object
>>
list
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
List
<
EquipmentAlarmDownloadVO
>
equipmentDownloads
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
ids
)
&&
0
<
ids
.
size
())
{
if
(
0
<
list
.
size
())
{
...
...
@@ -123,13 +124,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
alarmDownloadVO
.
setEquipCode
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"fireEquipmentCode"
))
?
alarm
.
get
(
"fireEquipmentCode"
).
toString
()
:
""
);
alarmDownloadVO
.
setAlarmPosition
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"warehouseStructureName"
))
?
alarm
.
get
(
"warehouseStructureName"
).
toString
()
:
""
);
alarmDownloadVO
.
setProtectObj
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"equipmentName"
))
?
alarm
.
get
(
"equipmentName"
).
toString
()
:
""
);
alarmDownloadVO
.
setAlarmTime
(
sdf
.
format
(
alarm
.
get
(
"createDate"
))
);
alarmDownloadVO
.
setAlarmTime
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"createDate"
))
?
alarm
.
get
(
"createDate"
).
toString
().
replace
(
"T"
,
" "
):
""
);
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
alarmDownloadVO
.
setHandleStatus
(
String
.
valueOf
(
alarm
.
get
(
"handleStatus"
)));
alarmDownloadVO
.
setHandleType
(
ConfirmAlamEnum
.
getTypeByCode
(
String
.
valueOf
(
alarm
.
get
(
"handleType"
))));
alarmDownloadVO
.
setResolveResult
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"resolveResult"
))
?
alarm
.
get
(
"resolveResult"
).
toString
()
:
""
);
alarmDownloadVO
.
setConfirmDate
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"confirmDate"
))
?
sdf
.
format
(
alarm
.
get
(
"confirmDate"
)
)
:
""
);
alarmDownloadVO
.
setConfirmDate
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"confirmDate"
))
?
alarm
.
get
(
"confirmDate"
).
toString
().
replace
(
"T"
,
" "
)
:
""
);
alarmDownloadVO
.
setAlarmReason
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"alarmReason"
))
?
alarm
.
get
(
"alarmReason"
).
toString
()
:
""
);
equipmentDownloads
.
add
(
alarmDownloadVO
);
}
...
...
@@ -150,13 +151,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
alarmDownloadVO
.
setEquipCode
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"fireEquipmentCode"
))
?
alarm
.
get
(
"fireEquipmentCode"
).
toString
()
:
""
);
alarmDownloadVO
.
setAlarmPosition
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"warehouseStructureName"
))
?
alarm
.
get
(
"warehouseStructureName"
).
toString
()
:
""
);
alarmDownloadVO
.
setProtectObj
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"equipmentName"
))
?
alarm
.
get
(
"equipmentName"
).
toString
()
:
""
);
alarmDownloadVO
.
setAlarmTime
(
sdf
.
format
(
alarm
.
get
(
"createDate"
))
);
alarmDownloadVO
.
setAlarmTime
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"createDate"
))
?
alarm
.
get
(
"createDate"
).
toString
().
replace
(
"T"
,
" "
):
""
);
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
alarmDownloadVO
.
setHandleStatus
(
String
.
valueOf
(
alarm
.
get
(
"handleStatus"
)));
alarmDownloadVO
.
setHandleType
(
ConfirmAlamEnum
.
getTypeByCode
(
String
.
valueOf
(
alarm
.
get
(
"handleType"
))));
alarmDownloadVO
.
setResolveResult
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"resolveResult"
))
?
alarm
.
get
(
"resolveResult"
).
toString
()
:
""
);
alarmDownloadVO
.
setConfirmDate
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"confirmDate"
))
?
sdf
.
format
(
alarm
.
get
(
"confirmDate"
)
)
:
""
);
alarmDownloadVO
.
setConfirmDate
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"confirmDate"
))
?
alarm
.
get
(
"confirmDate"
).
toString
().
replace
(
"T"
,
" "
)
:
""
);
alarmDownloadVO
.
setAlarmReason
(
StringUtil
.
isNotEmpty
(
alarm
.
get
(
"alarmReason"
))
?
alarm
.
get
(
"alarmReason"
).
toString
()
:
""
);
equipmentDownloads
.
add
(
alarmDownloadVO
);
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MainIotMonitorServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -27,6 +27,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -602,7 +603,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
// redis缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
return
RedisKey
.
buildReginKey
(
userId
,
token
)
;
}
protected
AgencyUserModel
getUser
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/QREquipmentDefServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -506,8 +507,7 @@ public class QREquipmentDefServiceImpl implements IQRCodeService<ScanResult<QREq
// redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
return
RedisKey
.
buildReginKey
(
userId
,
token
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/QREquipmentKnowledgeServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -1242,8 +1243,6 @@ public class QREquipmentKnowledgeServiceImpl implements IQRCodeService<ScanResul
// redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
return
RedisKey
.
buildReginKey
(
userId
,
token
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockBillDetailServiceImpl.java
View file @
8f6d1ed9
...
...
@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -130,9 +131,7 @@ public class StockBillDetailServiceImpl extends ServiceImpl<StockBillDetailMappe
}
// redi缓存选择的用户信息
private
String
buildKey
(
String
userId
,
String
token
)
{
return
"region_"
+
userId
+
"_"
+
token
;
return
RedisKey
.
buildReginKey
(
userId
,
token
);
}
}
amos-boot-system-equip/src/main/java/com/yeejoin/AmostEquipApplication.java
View file @
8f6d1ed9
...
...
@@ -12,6 +12,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.FilterType
;
import
org.springframework.core.env.Environment
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
...
...
@@ -24,7 +25,8 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.*.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.equipmanage.mapper"
})
@ComponentScan
({
"org.typroject"
,
"com.yeejoin.amos"
,
"com.yeejoin.equipmanage"
})
@ComponentScan
(
value
=
{
"org.typroject"
,
"com.yeejoin.amos"
,
"com.yeejoin.equipmanage"
},
excludeFilters
=
{
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
{
org
.
typroject
.
tyboot
.
core
.
restful
.
exception
.
GlobalExceptionHandler
.
class
})})
@EnableFeignClients
@EnableAsync
public
class
AmostEquipApplication
{
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentMapper.xml
View file @
8f6d1ed9
...
...
@@ -226,7 +226,7 @@ FROM
FROM
wl_equipment_specific_index si,
wl_equipment_index WI
where
SI
.equipment_index_id = WI.id and si.equipment_specific_id = #{equipmentSpecificId}
where
si
.equipment_index_id = WI.id and si.equipment_specific_id = #{equipmentSpecificId}
</select>
...
...
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