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
c9b6dbbe
Commit
c9b6dbbe
authored
Oct 08, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
754e3145
00fc0b7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
47 deletions
+34
-47
CheckTypeSuEnum.java
...eejoin/amos/supervision/common/enums/CheckTypeSuEnum.java
+4
-1
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+12
-15
ESElevatorServiceImpl.java
...ot/module/tzs/biz/service/impl/ESElevatorServiceImpl.java
+18
-31
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/src/main/java/com/yeejoin/amos/supervision/common/enums/CheckTypeSuEnum.java
View file @
c9b6dbbe
...
@@ -13,7 +13,10 @@ public enum CheckTypeSuEnum {
...
@@ -13,7 +13,10 @@ public enum CheckTypeSuEnum {
*/
*/
DAILY
(
"日常检查"
,
"1"
,
"daily"
),
DAILY
(
"日常检查"
,
"1"
,
"daily"
),
SPECIAL_RQ
(
"燃气专项"
,
"2"
,
"special"
),
SPECIAL_RQ
(
"燃气专项"
,
"2"
,
"special"
),
SPECIAL_GW
(
"高温专项"
,
"3"
,
"special"
);
SPECIAL_GW
(
"高温专项"
,
"3"
,
"special"
),
SPECIAL_DQ
(
"电气专项"
,
"4"
,
"special"
),
SPECIAL_HD
(
"重大活动专项"
,
"5"
,
"special"
),
SPECIAL_BZ
(
"重大保障专项"
,
"6"
,
"special"
);
/**
/**
* 名字
* 名字
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ExcelController.java
View file @
c9b6dbbe
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -19,14 +22,8 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -19,14 +22,8 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
/**
* 导出导入
* 导出导入
...
@@ -188,9 +185,9 @@ public class ExcelController extends BaseController {
...
@@ -188,9 +185,9 @@ public class ExcelController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出给提供设备接口"
)
@ApiOperation
(
value
=
"导出给提供设备接口"
)
@
PostMapping
(
"/exportForEquipment"
)
@
GetMapping
(
value
=
"/exportForEquipment"
)
public
ResponseModel
<
String
[]>
getFireStationFileByParams
(
@RequestParam
(
value
=
"type"
)
String
type
,
public
ResponseModel
<
String
[]>
getFireStationFileByParams
(
String
type
,
@RequestParam
(
value
=
"method"
)
String
method
)
{
String
method
)
{
try
{
try
{
return
ResponseHelper
.
buildResponse
(
dataSources
.
selectList
(
type
,
method
));
return
ResponseHelper
.
buildResponse
(
dataSources
.
selectList
(
type
,
method
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ESElevatorServiceImpl.java
View file @
c9b6dbbe
...
@@ -6,9 +6,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...
@@ -6,9 +6,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.ElevatorAlarm
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EsElevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EsElevator
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.LiftAlarmDealStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESElavtorRepository
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESElavtorRepository
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
@@ -119,20 +117,22 @@ public class ESElevatorServiceImpl {
...
@@ -119,20 +117,22 @@ public class ESElevatorServiceImpl {
qb4
.
must
(
QueryBuilders
.
termQuery
(
"sequenceNbr"
,
alertCalled
.
getEquipmentId
()));
qb4
.
must
(
QueryBuilders
.
termQuery
(
"sequenceNbr"
,
alertCalled
.
getEquipmentId
()));
boolMust
.
must
(
qb4
);
boolMust
.
must
(
qb4
);
}
else
{
}
else
{
if
(
elevatorDto
.
getIsToday
()
!=
null
&&
elevatorDto
.
getIsToday
())
{
if
(!
ValidationUtil
.
isEmpty
(
elevatorDto
.
getAlarmTypeCode
()))
{
queryWrapper
.
ge
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
));
if
(
elevatorDto
.
getIsToday
()
!=
null
&&
elevatorDto
.
getIsToday
())
{
queryWrapper
.
le
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
ge
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
));
}
queryWrapper
.
le
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
}
alertCalleds
=
iAlertCalledService
.
list
(
queryWrapper
);
alertCalleds
=
iAlertCalledService
.
list
(
queryWrapper
);
List
<
Long
>
stringList
=
new
ArrayList
<>();
List
<
Long
>
stringList
=
new
ArrayList
<>();
for
(
AlertCalled
al:
alertCalleds
for
(
AlertCalled
al:
alertCalleds
)
{
)
{
stringList
.
add
(
al
.
getEquipmentId
());
stringList
.
add
(
al
.
getEquipmentId
());
}
List
<
Long
>
listL
=
stringList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
qb0
.
should
(
QueryBuilders
.
termsQuery
(
"sequenceNbr"
,
listL
.
toArray
()));
boolMust
.
must
(
qb0
);
}
}
List
<
Long
>
listL
=
stringList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
qb0
.
should
(
QueryBuilders
.
termsQuery
(
"sequenceNbr"
,
listL
.
toArray
()));
boolMust
.
must
(
qb0
);
}
}
...
@@ -169,33 +169,20 @@ public class ESElevatorServiceImpl {
...
@@ -169,33 +169,20 @@ public class ESElevatorServiceImpl {
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
searchHit
.
getContent
());
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
searchHit
.
getContent
());
EsElevatorDto
esElevatorDto
=
JSONObject
.
toJavaObject
(
jsonObject
,
EsElevatorDto
.
class
);
EsElevatorDto
esElevatorDto
=
JSONObject
.
toJavaObject
(
jsonObject
,
EsElevatorDto
.
class
);
if
(
null
!=
alertCalled
)
{
if
(
null
!=
alertCalleds
)
{
// Elevator elevator = elevatorService.getById(esElevatorDto.getSequenceNbr());
LambdaQueryWrapper
<
ElevatorAlarm
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
ElevatorAlarm:
:
getRegisterCode
,
esElevatorDto
.
getRegisterCode
());
queryWrapper1
.
orderByDesc
(
ElevatorAlarm:
:
getStartDate
);
List
<
ElevatorAlarm
>
elevatorAlarms
=
elevatorAlarmServiceImpl
.
list
(
queryWrapper1
);
if
(
null
!=
elevatorAlarms
&&
elevatorAlarms
.
size
()
>
0
)
{
esElevatorDto
.
setType
(
elevatorAlarms
.
get
(
0
).
getType
());
esElevatorDto
.
setStatus
(
LiftAlarmDealStatusEnum
.
getEnum
(
elevatorAlarms
.
get
(
0
).
getDealStatus
()).
getName
());
}
esElevatorDto
.
setHappenTime
(
alertCalled
.
getCallTime
());
esElevatorDto
.
setAlertId
(
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
esElevatorDto
.
setAlarmTypeCode
(
alertCalled
.
getAlarmTypeCode
());
}
else
{
for
(
AlertCalled
al:
alertCalleds
for
(
AlertCalled
al:
alertCalleds
)
{
)
{
if
(
al
.
getEquipmentId
().
equals
(
esElevatorDto
.
getSequenceNbr
()))
{
if
(
al
.
getEquipmentId
().
equals
(
esElevatorDto
.
getSequenceNbr
()))
{
esElevatorDto
.
setHappenTime
(
al
.
getCallTime
());
esElevatorDto
.
setHappenTime
(
al
.
getCallTime
());
esElevatorDto
.
setAlertId
(
String
.
valueOf
(
al
.
getSequenceNbr
()));
esElevatorDto
.
setAlertId
(
String
.
valueOf
(
al
.
getSequenceNbr
()));
esElevatorDto
.
setAlarmTypeCode
(
al
.
getAlarmTypeCode
());
esElevatorDto
.
setAlarmTypeCode
(
al
.
getAlarmTypeCode
());
list
.
add
(
esElevatorDto
);
break
;
break
;
}
}
}
}
}
else
{
list
.
add
(
esElevatorDto
);
}
}
list
.
add
(
esElevatorDto
);
}
}
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
...
...
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