Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
import-fomater
Overview
Overview
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
姚闰伍
import-fomater
Commits
b3b50563
Commit
b3b50563
authored
Jan 04, 2019
by
蘑菇🍄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
dd0af10a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
OrderServiceImpl.java
src/main/java/com/gic/jpa/service/impl/OrderServiceImpl.java
+9
-10
OrderJsonFormatTest.java
src/test/java/com/gic/jpa/OrderJsonFormatTest.java
+5
-0
No files found.
src/main/java/com/gic/jpa/service/impl/OrderServiceImpl.java
View file @
b3b50563
...
...
@@ -82,6 +82,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
if
(
isJSON
(
order
.
getAmountPayableInfo
())
&&
isJSON
(
order
.
getDiscountAmountInfo
()))
{
copyList
.
remove
(
order
);
continue
;
}
order
.
setAmountPayableInfo
(
formatPayinfo
(
order
.
getAmountPayableInfo
()));
order
.
setDiscountAmountInfo
(
formatDiscount
(
order
.
getDiscountAmountInfo
()));
...
...
@@ -124,6 +125,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
if
(
isJSON
(
order
.
getAmountPayableInfo
())
&&
isJSON
(
order
.
getDiscountAmountInfo
()))
{
copyList
.
remove
(
order
);
continue
;
}
order
.
setAmountPayableInfo
(
formatPayinfo
(
order
.
getAmountPayableInfo
()));
order
.
setDiscountAmountInfo
(
formatDiscount
(
order
.
getDiscountAmountInfo
()));
...
...
@@ -209,7 +211,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
@Override
public
void
formatLogistics
()
{
handlerOrderLogistics
();
//
handlerOrderLogistics();
handlerOrderRefundLogistics
();
}
...
...
@@ -227,16 +229,14 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
CopyOnWriteArrayList
<
OrderLogistics
>
copyList
=
new
CopyOnWriteArrayList
(
page
.
getContent
());
for
(
OrderLogistics
order
:
copyList
)
{
if
(
isJSON
(
order
.
getLogisticsInformation
())
)
{
copyList
.
remove
(
order
);
}
order
.
setLogisticsInformation
(
formateTraces
(
order
.
getLogisticsInformation
()));
}
if
(
CollectionUtils
.
isEmpty
(
copyList
))
{
continue
;
if
(
!
CollectionUtils
.
isEmpty
(
copyList
))
{
orderLogisticsRepository
.
save
(
copyList
)
;
}
orderLogisticsRepository
.
save
(
copyList
);
}
}
...
...
@@ -254,9 +254,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
CopyOnWriteArrayList
<
OrderRefundLogistics
>
copyList
=
new
CopyOnWriteArrayList
(
page
.
getContent
());
for
(
OrderRefundLogistics
order
:
copyList
)
{
if
(
isJSON
(
order
.
getLogisticsInformation
())
)
{
copyList
.
remove
(
order
);
}
order
.
setLogisticsInformation
(
formateTraces
(
order
.
getLogisticsInformation
()));
}
...
...
@@ -284,6 +282,7 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
try
{
trace
.
put
(
"Traces"
,
JSON
.
parseArray
(
info
));
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"source:{}"
,
info
);
trace
.
put
(
"Traces"
,
new
JSONArray
());
}
...
...
src/test/java/com/gic/jpa/OrderJsonFormatTest.java
View file @
b3b50563
...
...
@@ -28,6 +28,11 @@ public class OrderJsonFormatTest extends GicJpaDemoApplicationTests{
}
@Test
public
void
testLogistics
()
{
format
.
formatLogistics
();
}
@Test
public
void
formatOrderTest
()
{
format
.
formatOrder
();
format
.
formatOrderItem
();
...
...
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