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
e8184a75
Commit
e8184a75
authored
Feb 08, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
8480ae78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+11
-4
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+7
-1
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+6
-1
StockServiceImpl.java
...om/yeejoin/equipmanage/service/impl/StockServiceImpl.java
+1
-3
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
e8184a75
...
@@ -31,14 +31,13 @@ import org.springframework.beans.BeanUtils;
...
@@ -31,14 +31,13 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -185,6 +184,14 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -185,6 +184,14 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
}
}
//数字换流站使用
//数字换流站使用
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQZXDT
.
getTopic
(),
""
);
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQZXDT
.
getTopic
(),
""
);
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override
// public void afterCommit() {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("seqNo", UUID.randomUUID().toString().replace("-", "").toLowerCase());
// mqttSendGateway.sendToMqtt(TopicEnum.ALARM_LOG_INSERT.getTopic(), jsonObject.toString());
// }
// });
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
BadRequest
(
"确认失败"
);
throw
new
BadRequest
(
"确认失败"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
e8184a75
...
@@ -7,7 +7,10 @@ import java.net.SocketException;
...
@@ -7,7 +7,10 @@ import java.net.SocketException;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.TemporalAccessor
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
...
@@ -194,7 +197,10 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -194,7 +197,10 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
mybatisResult
.
getRecords
().
forEach
(
x
->
{
mybatisResult
.
getRecords
().
forEach
(
x
->
{
AlarmListDataVO
dataVO
=
new
AlarmListDataVO
();
AlarmListDataVO
dataVO
=
new
AlarmListDataVO
();
try
{
try
{
dataVO
.
setAlarmTime
(
DateUtils
.
dateParse
(
String
.
valueOf
(
x
.
get
(
"createDate"
)),
DateUtils
.
DATE_TIME_T_PATTERN
));
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
DateUtils
.
DATE_TIME_PATTERN
);
String
time
=
df
.
format
((
TemporalAccessor
)
x
.
get
(
"createDate"
));
Date
date
=
DateUtils
.
dateParse
(
time
,
DateUtils
.
DATE_TIME_PATTERN
);
dataVO
.
setAlarmTime
(
date
);
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
e8184a75
...
@@ -11,6 +11,7 @@ import java.util.UUID;
...
@@ -11,6 +11,7 @@ import java.util.UUID;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
//import net.sf.json.JSONObject;
//import net.sf.json.JSONObject;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -212,6 +213,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -212,6 +213,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
final
static
Map
staticMap
=
new
HashMap
();
private
final
static
Map
staticMap
=
new
HashMap
();
private
static
Boolean
bool
=
Boolean
.
FALSE
;
static
{
static
{
staticMap
.
put
(
"FireCar_GDLongitude"
,
"0"
);
staticMap
.
put
(
"FireCar_GDLongitude"
,
"0"
);
staticMap
.
put
(
"FireCar_GDLatitude"
,
"0"
);
staticMap
.
put
(
"FireCar_GDLatitude"
,
"0"
);
...
@@ -450,6 +453,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -450,6 +453,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
}
else
{
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
equipmentSpecificAlarmLogService
);
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
equipmentSpecificAlarmLogService
);
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
}
}
specificAlarmIds
.
add
(
action
.
getId
());
specificAlarmIds
.
add
(
action
.
getId
());
equipIndexIds
.
add
(
action
.
getEquipmentIndexId
());
equipIndexIds
.
add
(
action
.
getEquipmentIndexId
());
...
@@ -496,7 +501,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -496,7 +501,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
iEquipmentSpecificSerivce
.
updateEquipmentSpecIndexRealtimeData
(
equipmentSpecificIndexList
);
iEquipmentSpecificSerivce
.
updateEquipmentSpecIndexRealtimeData
(
equipmentSpecificIndexList
);
//数字换流站站使用
//数字换流站站使用
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQZXDT
.
getTopic
(),
""
);
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQZXDT
.
getTopic
(),
""
);
if
(!
equipmentAlarmLogs
.
isEmpty
())
{
if
(!
equipmentAlarmLogs
.
isEmpty
()
||
bool
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"seqNo"
,
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
toLowerCase
());
jsonObject
.
put
(
"seqNo"
,
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
toLowerCase
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
ALARM_LOG_INSERT
.
getTopic
(),
jsonObject
.
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
ALARM_LOG_INSERT
.
getTopic
(),
jsonObject
.
toString
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockServiceImpl.java
View file @
e8184a75
...
@@ -329,8 +329,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -329,8 +329,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}
}
}
}
//插入模板信息
//插入模板信息
EquipmentDetail
equipmentDetail
=
new
EquipmentDetail
();
EquipmentDetail
equipmentDetail
=
new
EquipmentDetail
();
equipmentDetail
.
setCode
(
equipmentDetailDownloadVOS
.
get
(
i
).
getCode
());
equipmentDetail
.
setCode
(
equipmentDetailDownloadVOS
.
get
(
i
).
getCode
());
...
@@ -344,6 +342,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -344,6 +342,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentDetail
.
setManufacturerName
(
equipmentDetailDownloadVOS
.
get
(
i
).
getManufacturerName
());
equipmentDetail
.
setManufacturerName
(
equipmentDetailDownloadVOS
.
get
(
i
).
getManufacturerName
());
}
}
equipmentDetail
.
setEquipmentId
(
equipment
.
getId
());
equipmentDetail
.
setEquipmentId
(
equipment
.
getId
());
equipmentDetail
.
setEquipmentName
(
equipment
.
getName
());
equipmentDetail
.
setName
(
equipmentDetailDownloadVOS
.
get
(
i
).
getName
());
equipmentDetail
.
setName
(
equipmentDetailDownloadVOS
.
get
(
i
).
getName
());
equipmentDetail
.
setArea
(
equipmentDetailDownloadVOS
.
get
(
i
).
getDescription
());
equipmentDetail
.
setArea
(
equipmentDetailDownloadVOS
.
get
(
i
).
getDescription
());
...
@@ -354,7 +353,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -354,7 +353,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentDetail
.
setCompanyName
(
company
[
0
]);
equipmentDetail
.
setCompanyName
(
company
[
0
]);
}
}
equipmentDetailMapper
.
insert
(
equipmentDetail
);
equipmentDetailMapper
.
insert
(
equipmentDetail
);
//生成单件设备信息
//生成单件设备信息
...
...
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