Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mall-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
yimu
mall-server
Commits
77004fe0
Commit
77004fe0
authored
Dec 28, 2021
by
秦兴亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最新代码
parent
63be8cac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
OrderServiceImpl.java
...all/server/front/order/service/impl/OrderServiceImpl.java
+6
-10
No files found.
mall-server-front/src/main/java/com/fzm/mall/server/front/order/service/impl/OrderServiceImpl.java
View file @
77004fe0
...
@@ -331,21 +331,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
...
@@ -331,21 +331,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
int
saleType
=
spuService
.
getNftSalesType
(
orderSkuVo
.
getSkuId
());
int
saleType
=
spuService
.
getNftSalesType
(
orderSkuVo
.
getSkuId
());
if
(
saleType
==
2
){
if
(
saleType
==
2
){
String
serialNo
=
skuService
.
getSerialNo
(
skuVo
.
getCommodityPassId
());
String
serialNo
=
skuService
.
getSerialNo
(
skuVo
.
getCommodityPassId
());
JSONArray
array
=
JSON
.
parseArray
(
serialNo
);
List
<
Long
>
array
=
JSON
.
parseArray
(
serialNo
,
Long
.
class
);
if
(
array
.
size
()<
orderSkuVo
.
getNum
()){
if
(
array
.
size
()<
orderSkuVo
.
getNum
()){
throw
new
RuntimeException
(
"库存不足!!!"
);
throw
new
RuntimeException
(
"库存不足!!!"
);
}
}
int
index
=
1
;
int
index
=
1
;
List
<
Stri
ng
>
list
=
new
ArrayList
<>();
List
<
Lo
ng
>
list
=
new
ArrayList
<>();
for
(
Object
o:
array
)
{
for
(
Long
o:
array
)
{
if
(
index
<=
orderSkuVo
.
getNum
()){
if
(
index
<=
orderSkuVo
.
getNum
()){
list
.
add
(
o
.
toString
()
);
list
.
add
(
o
);
index
++;
index
++;
}
else
{
}
else
{
break
;
break
;
}
}
}
}
array
.
remove
(
list
);
boolean
remove
=
array
.
remove
(
list
);
skuService
.
updateSerialNo
(
JSON
.
toJSONString
(
array
),
skuVo
.
getCommodityPassId
());
skuService
.
updateSerialNo
(
JSON
.
toJSONString
(
array
),
skuVo
.
getCommodityPassId
());
orderDetail
.
setSerialNo
(
JSON
.
toJSONString
(
list
));
orderDetail
.
setSerialNo
(
JSON
.
toJSONString
(
list
));
}
}
...
@@ -1349,11 +1349,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
...
@@ -1349,11 +1349,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
return
null
;
return
null
;
}
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
;
JSONArray
array
=
JSON
.
parseArray
(
str
);
System
.
out
.
println
(
array
.
toJSONString
());
}
/* private String tranCoinAndNft(String skuId,String from,String to,BigDecimal number,int goodsType,String coin) {
/* private String tranCoinAndNft(String skuId,String from,String to,BigDecimal number,int goodsType,String coin) {
//商品通证(0.否 1.是,自动生成Token 2.是,使用外部既有Token)
//商品通证(0.否 1.是,自动生成Token 2.是,使用外部既有Token)
...
@@ -1396,4 +1391,5 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
...
@@ -1396,4 +1391,5 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
}*/
}*/
}
}
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