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 52b052f6
authored
Jan 02, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工单标准接口-校验
1 parent
0932ae5f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
src/main/java/cn/com/glsx/stdinterface/modules/service/BhgBizService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/BhgBizService.java
View file @
52b052f
...
@@ -6,8 +6,8 @@ import cn.com.glsx.stdinterface.modules.util.MD5Util;
...
@@ -6,8 +6,8 @@ import cn.com.glsx.stdinterface.modules.util.MD5Util;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.common.utils.HttpUtils
;
import
com.glsx.plat.common.utils.HttpUtils
;
import
com.glsx.plat.context.utils.PropertiesUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -18,6 +18,9 @@ import java.util.TreeMap;
...
@@ -18,6 +18,9 @@ import java.util.TreeMap;
@Service
@Service
public
class
BhgBizService
{
public
class
BhgBizService
{
@Value
(
"${bhg_access_orderService_url}"
)
private
String
bhgOrderServiceUrl
;
/**
/**
* md5加密
* md5加密
*
*
...
@@ -66,9 +69,9 @@ public class BhgBizService {
...
@@ -66,9 +69,9 @@ public class BhgBizService {
String
sign
=
getParamsMD5Sign
(
map
);
String
sign
=
getParamsMD5Sign
(
map
);
map
.
put
(
"sign"
,
sign
);
map
.
put
(
"sign"
,
sign
);
String
url
=
PropertiesUtils
.
getProperty
(
"bhg_access_orderService_url"
)
+
"api/standardOrder/save?"
;
String
url
=
bhgOrderServiceUrl
+
"api/standardOrder/save?"
;
if
(
isUpdate
)
{
if
(
isUpdate
)
{
url
=
PropertiesUtils
.
getProperty
(
"bhg_access_orderService_url"
)
+
"api/standardOrder/update?"
;
url
=
bhgOrderServiceUrl
+
"api/standardOrder/update?"
;
}
}
String
body
=
JSONUtil
.
toJsonStr
(
map
);
String
body
=
JSONUtil
.
toJsonStr
(
map
);
log
.
info
(
"同步{}工单{}到包活干参数:{}"
,
!
isUpdate
?
"新增"
:
"更新"
,
workOrder
.
getOrderNo
(),
body
);
log
.
info
(
"同步{}工单{}到包活干参数:{}"
,
!
isUpdate
?
"新增"
:
"更新"
,
workOrder
.
getOrderNo
(),
body
);
...
...
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
View file @
52b052f
...
@@ -354,7 +354,7 @@ public class WorkOrderService {
...
@@ -354,7 +354,7 @@ public class WorkOrderService {
//如果是自平台,无需转换
//如果是自平台,无需转换
if
(
WorkOrderSourceEnum
.
NE_SHIELD
.
getCode
().
equals
(
orderReq
.
getOrderSource
()))
{
if
(
WorkOrderSourceEnum
.
NE_SHIELD
.
getCode
().
equals
(
orderReq
.
getOrderSource
()))
{
return
woVehicle
.
getDeviceCompose
();
return
"NES"
+
woVehicle
.
getDeviceCompose
();
}
}
if
(
StringUtils
.
isNotBlank
(
deviceCompose
)
&&
deviceCompose
.
endsWith
(
";"
))
{
if
(
StringUtils
.
isNotBlank
(
deviceCompose
)
&&
deviceCompose
.
endsWith
(
";"
))
{
...
@@ -639,8 +639,10 @@ public class WorkOrderService {
...
@@ -639,8 +639,10 @@ public class WorkOrderService {
List
<
VehicleDevice
>
vdList
=
vehicleDeviceMapper
.
selectBindingDevices
(
snSet
);
List
<
VehicleDevice
>
vdList
=
vehicleDeviceMapper
.
selectBindingDevices
(
snSet
);
Set
<
String
>
existSnSet
=
vdList
.
stream
().
map
(
VehicleDevice:
:
getSn
).
collect
(
Collectors
.
toSet
());
if
(
vdList
.
size
()
>
0
)
{
if
(
vdList
.
size
()
>
0
)
{
throw
new
StdInterfaceException
(
"656565"
,
"设备已绑定车辆,请更换设备"
);
throw
new
StdInterfaceException
(
"656565"
,
String
.
format
(
"设备%s已绑定车辆,请更换设备"
,
existSnSet
)
);
}
}
}
}
...
@@ -684,6 +686,7 @@ public class WorkOrderService {
...
@@ -684,6 +686,7 @@ public class WorkOrderService {
docs
.
setWorkOrderId
(
finalWorkOrder
.
getId
());
docs
.
setWorkOrderId
(
finalWorkOrder
.
getId
());
docs
.
setName
(
picture
.
getName
());
docs
.
setName
(
picture
.
getName
());
docs
.
setPath
(
picture
.
getUrl
());
docs
.
setPath
(
picture
.
getUrl
());
docs
.
setCreatedDate
(
new
Date
());
pictures
.
add
(
docs
);
pictures
.
add
(
docs
);
});
});
workOrderDocsMapper
.
insertList
(
pictures
);
workOrderDocsMapper
.
insertList
(
pictures
);
...
...
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