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 d2b46c32
authored
Dec 20, 2021
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工单标准接口
1 parent
463602ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
29 deletions
pom.xml
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
pom.xml
View file @
d2b46c3
...
...
@@ -21,26 +21,23 @@
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
glsx-ne-shield-common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<artifactId>
rest-admin-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-swagger2
</artifactId>
<scope>
compile
</scope>
<artifactId>
rest-admin-mybatis
</artifactId>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-mybatis
</artifactId>
<scope>
compile
</scope>
<artifactId>
rest-admin-office
</artifactId>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-office
</artifactId>
<artifactId>
glsx-ne-shield-common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
...
...
@@ -48,6 +45,7 @@
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-standard-interfaces-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- 监控中心 devicemonitor-api -->
...
...
@@ -55,6 +53,7 @@
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-devicemonitor-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- 警情中心 alarmcenter-api -->
...
...
@@ -62,6 +61,7 @@
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-alarmcenter-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- usercenter-api -->
...
...
@@ -69,6 +69,7 @@
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-usercenter-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
...
...
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
View file @
d2b46c3
...
...
@@ -110,7 +110,7 @@ public class WorkOrderService {
if
(
CollectionUtils
.
isNotEmpty
(
orderReq
.
getVehicles
()))
{
woVehicle
=
WorkOrderVehicleConverter
.
INSTANCE
.
bo2do
(
orderReq
.
getVehicles
().
get
(
0
));
woVehicle
.
setWorkOrderId
(
workOrder
.
getId
());
woVehicle
.
setDeviceCompose
(
transBhgServiceCode
(
orderReq
.
getOrderSource
()
,
woVehicle
));
woVehicle
.
setDeviceCompose
(
transBhgServiceCode
(
orderReq
,
woVehicle
));
woVehicle
.
setStatus
(
0
);
woVehicle
.
setCreatedDate
(
now
);
log
.
info
(
"工单车辆信息:{}"
,
JSONUtil
.
toJsonStr
(
woVehicle
));
...
...
@@ -122,7 +122,7 @@ public class WorkOrderService {
return
workOrderNo
;
}
private
String
transBhgServiceCode
(
String
orderSource
,
WorkOrderVehicle
woVehicle
)
{
private
String
transBhgServiceCode
(
InstallWorkOrderBO
orderReq
,
WorkOrderVehicle
woVehicle
)
{
String
deviceCompose
=
woVehicle
.
getDeviceCompose
();
if
(
StringUtils
.
isNotBlank
(
deviceCompose
)
&&
deviceCompose
.
endsWith
(
";"
))
{
...
...
@@ -138,27 +138,33 @@ public class WorkOrderService {
String
device
=
devices
[
i
];
boolean
containWired
=
device
.
contains
(
"GPSC:700B"
);
if
(
containWired
)
{
wiredCnt
=
1
;
//默认一个
String
[]
deviceAndCnt
=
device
.
split
(
":"
);
if
(
deviceAndCnt
.
length
>
1
)
{
wiredCnt
+=
Integer
.
parseInt
(
device
.
split
(
":"
)[
1
]);
if
(
deviceAndCnt
.
length
>
2
)
{
wiredCnt
+=
Integer
.
parseInt
(
device
.
split
(
":"
)[
2
]);
}
}
boolean
containWireless
=
device
.
contains
(
"GPSW:703B"
);
if
(
containWireless
)
{
wirelessCnt
=
1
;
//默认一个
String
[]
deviceAndCnt
=
device
.
split
(
":"
);
if
(
deviceAndCnt
.
length
>
1
)
{
wirelessCnt
+=
Integer
.
parseInt
(
device
.
split
(
":"
)[
1
]);
if
(
deviceAndCnt
.
length
>
2
)
{
wirelessCnt
+=
Integer
.
parseInt
(
device
.
split
(
":"
)[
2
]);
}
}
}
if
(
"Y"
.
equalsIgnoreCase
(
orderReq
.
getNeedInstall
()))
{
Integer
allCnt
=
wiredCnt
+
wirelessCnt
;
if
(
allCnt
<=
0
)
{
throw
new
StdInterfaceException
(
"214541"
,
deviceCompose
+
"设备组合解析失败"
);
}
}
String
deviceSign
=
"0"
+
wiredCnt
+
wirelessCnt
;
log
.
info
(
"工单{}设备组合为{}"
,
woVehicle
.
getWorkOrderId
(),
deviceSign
);
woVehicle
.
setDeviceCompose
(
deviceSign
);
String
serviceCode
=
getBhgServiceCode
(
order
Source
,
deviceSign
);
String
serviceCode
=
getBhgServiceCode
(
order
Req
.
getOrderSource
()
,
deviceSign
);
return
serviceCode
;
}
...
...
@@ -204,19 +210,20 @@ public class WorkOrderService {
* @return
*/
public
Long
assignAuth
(
String
account
)
{
R
<
List
<
User
>>
userR
=
apiUserService
.
findByAccount
(
account
);
log
.
info
(
"userR==="
+
JSON
.
toJSONString
(
userR
));
Long
userId
=
0L
;
if
(
userR
.
isSuccess
())
{
List
<
User
>
userList
=
userR
.
getDataList
(
new
TypeToken
<
List
<
User
>>()
{
}.
getType
());
if
(
CollectionUtils
.
isNotEmpty
(
userList
))
{
userId
=
userList
.
get
(
0
).
getId
();
}
else
{
//找不到默认归到运营账号
userId
=
Long
.
valueOf
(
PropertiesUtils
.
getProperty
(
"bhg.vehicle.createBy.id"
));
log
.
warn
(
"找不到对应归属账号{},改归到运营账号{},请检查"
,
account
,
userId
);
//找不到默认归到运营账号
Long
userId
=
Long
.
valueOf
(
PropertiesUtils
.
getProperty
(
"operators.user.id"
));
try
{
R
<
List
<
User
>>
userR
=
apiUserService
.
findByAccount
(
account
);
log
.
info
(
"userR==="
+
JSON
.
toJSONString
(
userR
));
if
(
userR
.
isSuccess
())
{
List
<
User
>
userList
=
userR
.
getDataList
(
new
TypeToken
<
List
<
User
>>()
{
}.
getType
());
if
(
CollectionUtils
.
isNotEmpty
(
userList
))
{
userId
=
userList
.
get
(
0
).
getId
();
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"根据账号名{}获取账号id失败,exception:{}"
,
account
,
e
.
getMessage
());
}
return
userId
;
}
...
...
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