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
d7c40c55
Commit
d7c40c55
authored
Jul 22, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单基础信息
parent
59db1e79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
18 deletions
+83
-18
TWorkOrderServiceImpl.java
...com/zehong/system/service/impl/TWorkOrderServiceImpl.java
+83
-18
No files found.
gassafety-system/src/main/java/com/zehong/system/service/impl/TWorkOrderServiceImpl.java
View file @
d7c40c55
...
...
@@ -5,15 +5,13 @@ import java.util.List;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.ExceptionUtil
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.*
;
import
com.zehong.system.domain.vo.WorkOrderVo
;
import
com.zehong.system.mapper.SysUserMapper
;
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
;
import
com.zehong.system.mapper.TWorkOrderMapper
;
import
com.zehong.system.domain.TWorkOrder
;
import
com.zehong.system.service.ITWorkOrderService
;
/**
...
...
@@ -29,17 +27,21 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
private
TWorkOrderMapper
tWorkOrderMapper
;
@Autowired
private
SysUserMapper
sysUserMapper
;
@Autowired
private
TInspectionDataMapper
tInspectionDataMapper
;
@Autowired
private
TInspectionPlanMapper
tInspectionPlanMapper
;
@Autowired
private
THiddenTroubleMapper
tHiddenTroubleMapper
;
@Autowired
private
TDeviceAlarmMapper
tDeviceAlarmMapper
;
@Autowired
private
TPipeMapper
tPipeMapper
;
@Autowired
private
TDeviceInfoMapper
tDeviceInfoMapper
;
/**
* 获取工单基础信息id
*
* @return 工单基础信息id
*/
@Override
public
String
getWorkOrderId
()
{
return
tWorkOrderMapper
.
getWorkOrderId
();
}
@Autowired
private
ITInspectionPlanService
tInspectionPlanService
;
/**
* 查询工单基础信息
...
...
@@ -68,14 +70,48 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
// 获取源数据(1巡检信息,2隐患信息,3报警信息)
String
orderType
=
tWorkOrder
.
getOrderType
();
int
resourceId
=
tWorkOrder
.
getResourceId
();
if
(
"1"
.
equals
(
orderType
)){
}
else
if
(
"2"
.
equals
(
orderType
))
{
TInspectionPlan
plan
=
tInspectionPlanMapper
.
selectTInspectionPlanById
(
resourceId
);
workOrderVo
.
setDeviceIds
(
plan
.
getDeviceCodes
());
TInspectionData
data
=
new
TInspectionData
();
data
.
setPlanId
(
resourceId
);
List
<
TInspectionData
>
totalList
=
tInspectionDataMapper
.
selectTInspectionDataList
(
data
);
workOrderVo
.
setDeviceNum
(
totalList
.
size
());
int
finish
=
tInspectionDataMapper
.
selectFinishTInspectionData
(
resourceId
);
workOrderVo
.
setFinishNum
(
finish
);
}
else
if
(
"2"
.
equals
(
orderType
)){
THiddenTrouble
trouble
=
tHiddenTroubleMapper
.
selectTHiddenTroubleById
(
resourceId
);
workOrderVo
.
setDeviceIds
((
trouble
.
getDeviceCode
()
!=
null
?
trouble
.
getDeviceCode
()
:
null
).
toString
());
workOrderVo
.
setLongitude
(
trouble
.
getLongitude
()
!=
null
?
trouble
.
getLongitude
()
:
null
);
workOrderVo
.
setLatitude
(
trouble
.
getLatitude
()
!=
null
?
trouble
.
getLatitude
()
:
null
);
workOrderVo
.
setCoordinates
(
trouble
.
getCoordinates
()
!=
null
?
trouble
.
getCoordinates
()
:
null
);
workOrderVo
.
setDeviceType
(
trouble
.
getDeviceType
());
}
else
{
}
TDeviceAlarm
alarm
=
tDeviceAlarmMapper
.
selectTDeviceAlarmById
(
resourceId
);
String
deviceCode
=
alarm
.
getDeviceCode
();
workOrderVo
.
setDeviceIds
(
String
.
valueOf
(
deviceCode
));
String
isPipe
=
alarm
.
getIsPipe
();
if
(
"0"
.
equals
(
isPipe
)){
TPipe
pipe
=
tPipeMapper
.
selectTPipeByCode
(
deviceCode
);
workOrderVo
.
setCoordinates
(
pipe
.
getCoordinates
());
workOrderVo
.
setDeviceType
(
"0"
);
}
else
{
TDeviceInfo
device
=
tDeviceInfoMapper
.
selectTDeviceInfoByCode
(
deviceCode
);
workOrderVo
.
setLongitude
(
device
.
getLongitude
());
workOrderVo
.
setLatitude
(
device
.
getLatitude
());
workOrderVo
.
setDeviceType
(
device
.
getDeviceType
());
}
}
return
workOrderVo
;
}
...
...
@@ -124,9 +160,17 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public
int
insertTWorkOrder
(
TWorkOrder
tWorkOrder
)
{
String
orderId
=
tWorkOrderMapper
.
getWorkOrderId
();
tWorkOrder
.
setOrderId
(
orderId
);
tWorkOrder
.
setOrderStatus
(
"0"
);
tWorkOrder
.
setCreateTime
(
DateUtils
.
getNowDate
());
int
planId
=
tWorkOrder
.
getResourceId
();
// 修改巡检计划状态为已下发
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanStatus
(
"1"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
return
tWorkOrderMapper
.
insertTWorkOrder
(
tWorkOrder
);
}
...
...
@@ -139,6 +183,27 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
@Override
public
int
updateTWorkOrder
(
TWorkOrder
tWorkOrder
)
{
if
(
"1"
.
equals
(
tWorkOrder
.
getOrderStatus
())){
TWorkOrder
order
=
tWorkOrderMapper
.
selectTWorkOrderById
(
tWorkOrder
.
getOrderId
());
int
planId
=
order
.
getResourceId
();
// 修改巡检计划状态为进行中
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanStatus
(
"2"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
}
else
if
(
"4"
.
equals
(
tWorkOrder
.
getOrderStatus
())){
TWorkOrder
order
=
tWorkOrderMapper
.
selectTWorkOrderById
(
tWorkOrder
.
getOrderId
());
int
planId
=
order
.
getResourceId
();
// 修改巡检计划状态为已完成
TInspectionPlan
plan
=
new
TInspectionPlan
();
plan
.
setPlanId
(
planId
);
plan
.
setPlanStatus
(
"3"
);
tInspectionPlanService
.
updateTInspectionPlan
(
plan
);
}
return
tWorkOrderMapper
.
updateTWorkOrder
(
tWorkOrder
);
}
...
...
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