Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 802ae99a
authored
Dec 22, 2021
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工单标准接口
1 parent
9847b381
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
src/main/java/cn/com/glsx/stdinterface/modules/mapper/VehicleDeviceMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
src/main/resources/mapper/VehicleDeviceMapper.xml
src/main/java/cn/com/glsx/stdinterface/modules/mapper/VehicleDeviceMapper.java
View file @
802ae99
...
...
@@ -5,6 +5,7 @@ import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Collection
;
import
java.util.List
;
/**
...
...
@@ -20,4 +21,6 @@ public interface VehicleDeviceMapper extends CommonBaseMapper<VehicleDevice> {
List
<
VehicleDevice
>
selectAllBindingDevices
();
List
<
VehicleDevice
>
selectBindingDevices
(
@Param
(
"sns"
)
Collection
<
String
>
sns
);
}
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
View file @
802ae99
...
...
@@ -35,6 +35,8 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
...
...
@@ -359,6 +361,8 @@ public class WorkOrderService {
checkWorkOrder
(
workOrder
);
checkWorkOrderDevices
(
verifyBO
.
getDevices
());
List
<
DeviceLocationItem
>
devices
=
Lists
.
newArrayList
();
//目前只有GPS设备
verifyBO
.
getDevices
().
forEach
(
device
->
{
...
...
@@ -413,6 +417,25 @@ public class WorkOrderService {
}
/**
* 验证设备存在、激活等状态
*
* @param devices
*/
private
void
checkWorkOrderDevices
(
List
<
SimpleDeviceItem
>
devices
)
{
if
(
CollectionUtils
.
isEmpty
(
devices
))
{
throw
new
StdInterfaceException
(
"656565"
,
"验证设备不能为空"
);
}
Set
<
String
>
snSet
=
devices
.
stream
().
map
(
SimpleDeviceItem:
:
getSn
).
collect
(
Collectors
.
toSet
());
List
<
VehicleDevice
>
vdList
=
vehicleDeviceMapper
.
selectBindingDevices
(
snSet
);
if
(
vdList
.
size
()
>
0
)
{
throw
new
StdInterfaceException
(
"656565"
,
"验证设备不能为空"
);
}
}
/**
* 激活工单信息,激活是以车为单位,不是以工单,一个工单可以包含多辆车
*
* @param orderReq
...
...
@@ -487,6 +510,8 @@ public class WorkOrderService {
});
vehicleDeviceMapper
.
insertList
(
devices
);
}
// TODO: 2021/12/22 通知e盾库
return
activatedDevices
;
}
...
...
src/main/resources/mapper/VehicleDeviceMapper.xml
View file @
802ae99
...
...
@@ -42,4 +42,16 @@
where del_flag = 0
and bind_status = 1
</select>
<select
id=
"selectBindingDevices"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_vehicle_device
where del_flag = 0
and bind_status = 1
and sn in
<foreach
collection=
"sns"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment