Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
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
耿迪迪
gassafety
Commits
a3024198
Commit
a3024198
authored
Jul 26, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单详情添加报警设备信息
parent
7c019c38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
21 deletions
+47
-21
TWorkOrderServiceImpl.java
...com/zehong/system/service/impl/TWorkOrderServiceImpl.java
+47
-21
No files found.
gassafety-system/src/main/java/com/zehong/system/service/impl/TWorkOrderServiceImpl.java
View file @
a3024198
...
...
@@ -8,7 +8,6 @@ import com.zehong.common.utils.DateUtils;
import
com.zehong.system.domain.*
;
import
com.zehong.system.domain.vo.WorkOrderVo
;
import
com.zehong.system.mapper.*
;
import
com.zehong.system.service.ITInspectionPlanService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -42,9 +41,6 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
@Autowired
private
TDeviceInfoMapper
tDeviceInfoMapper
;
@Autowired
private
ITInspectionPlanService
tInspectionPlanService
;
/**
* 查询工单基础信息
*
...
...
@@ -73,6 +69,9 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
// 获取源数据(1巡检信息,2隐患信息,3报警信息)
String
orderType
=
tWorkOrder
.
getOrderType
();
int
resourceId
=
tWorkOrder
.
getResourceId
();
List
<
TDeviceInfo
>
deviceInfoList
=
new
ArrayList
<>();
if
(
"1"
.
equals
(
orderType
)){
TInspectionPlan
plan
=
tInspectionPlanMapper
.
selectTInspectionPlanById
(
resourceId
);
...
...
@@ -84,21 +83,18 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
List
<
TInspectionData
>
totalList
=
tInspectionDataMapper
.
selectTInspectionDataList
(
data
);
workOrderVo
.
setDeviceNum
(
totalList
.
size
());
List
<
TDeviceInfo
>
deviceInfoList
=
new
ArrayList
<>();
TDeviceInfo
deviceInfo
=
null
;
for
(
TInspectionData
temp
:
totalList
){
deviceInfo
=
tDeviceInfoMapper
.
selectTDeviceInfoByCode
(
temp
.
getDeviceCode
());
if
(
deviceInfo
!=
null
){
deviceInfoList
.
add
(
deviceInfo
);
}
}
workOrderVo
.
setDeviceInfoList
(
deviceInfoList
);
int
finish
=
tInspectionDataMapper
.
selectFinishTInspectionData
(
resourceId
);
workOrderVo
.
setFinishNum
(
finish
);
}
else
if
(
"2"
.
equals
(
orderType
)){
}
else
if
(
"2"
.
equals
(
orderType
))
{
THiddenTrouble
trouble
=
tHiddenTroubleMapper
.
selectTHiddenTroubleById
(
resourceId
);
workOrderVo
.
setDeviceCodes
((
trouble
.
getDeviceCode
()
!=
null
?
trouble
.
getDeviceCode
()
:
null
).
toString
());
...
...
@@ -108,7 +104,13 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo
.
setDeviceType
(
trouble
.
getDeviceType
());
workOrderVo
.
setAddress
(
trouble
.
getAddress
());
}
else
{
String
deviceCode
=
trouble
.
getDeviceCode
();
TDeviceInfo
device
=
tDeviceInfoMapper
.
selectTDeviceInfoByCode
(
deviceCode
);
if
(
device
!=
null
){
deviceInfoList
.
add
(
device
);
}
}
else
if
(
"3"
.
equals
(
orderType
))
{
TDeviceAlarm
alarm
=
tDeviceAlarmMapper
.
selectTDeviceAlarmById
(
resourceId
);
String
deviceCode
=
alarm
.
getDeviceCode
();
...
...
@@ -122,12 +124,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo
.
setAddress
(
pipe
.
getPipeAddr
());
}
else
{
TDeviceInfo
device
=
tDeviceInfoMapper
.
selectTDeviceInfoByCode
(
deviceCode
);
if
(
device
!=
null
){
workOrderVo
.
setLongitude
(
device
.
getLongitude
());
workOrderVo
.
setLatitude
(
device
.
getLatitude
());
workOrderVo
.
setDeviceType
(
device
.
getDeviceType
());
workOrderVo
.
setAddress
(
device
.
getDeviceAddr
());
deviceInfoList
.
add
(
device
);
}
}
}
workOrderVo
.
setDeviceInfoList
(
deviceInfoList
);
List
<
TOrderFeedback
>
feedbackList
=
tOrderFeedbackMapper
.
selectTOrderFeedbackByOrderId
(
tWorkOrder
.
getOrderId
());
if
(
feedbackList
.
size
()
!=
0
){
...
...
@@ -185,16 +191,34 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public
int
insertTWorkOrder
(
TWorkOrder
tWorkOrder
)
throws
Exception
{
String
orderId
=
tWorkOrderMapper
.
getWorkOrderId
();
int
resourceId
=
tWorkOrder
.
getResourceId
();
tWorkOrder
.
setOrderId
(
orderId
);
tWorkOrder
.
setOrderStatus
(
"0"
);
tWorkOrder
.
setAllotTime
(
DateUtils
.
getNowDate
());
i
nt
planId
=
tWorkOrder
.
getResourceId
();
i
f
(
"1"
.
equals
(
tWorkOrder
.
getOrderType
())){
// 修改巡检计划状态为已下发
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanId
(
resourceId
);
plan
.
setOrderId
(
orderId
);
plan
.
setPlanStatus
(
"1"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
plan
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tInspectionPlanMapper
.
updateTInspectionPlan
(
plan
);
}
else
if
(
"2"
.
equals
(
tWorkOrder
.
getOrderType
()))
{
THiddenTrouble
trouble
=
new
THiddenTrouble
();
trouble
.
setTroubleId
(
resourceId
);
trouble
.
setOrderId
(
orderId
);
trouble
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tHiddenTroubleMapper
.
updateTHiddenTrouble
(
trouble
);
}
else
if
(
"3"
.
equals
(
tWorkOrder
.
getOrderType
()))
{
TDeviceAlarm
alarm
=
new
TDeviceAlarm
();
alarm
.
setAlarmId
(
resourceId
);
alarm
.
setOrderId
(
orderId
);
alarm
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tDeviceAlarmMapper
.
updateTDeviceAlarm
(
alarm
);
}
return
tWorkOrderMapper
.
insertTWorkOrder
(
tWorkOrder
);
}
...
...
@@ -216,7 +240,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanStatus
(
"2"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
plan
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tInspectionPlanMapper
.
updateTInspectionPlan
(
plan
);
}
else
if
(
"4"
.
equals
(
tWorkOrder
.
getOrderStatus
())){
...
...
@@ -226,7 +251,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanStatus
(
"3"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
plan
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tInspectionPlanMapper
.
updateTInspectionPlan
(
plan
);
}
tWorkOrder
.
setUpdateTime
(
DateUtils
.
getNowDate
());
...
...
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