Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
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
周健威
rs-cloud-platform
Commits
51a75a1f
Commit
51a75a1f
authored
Dec 30, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
a0048a45
b2f91d3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
79 deletions
+79
-79
IndustryApplicationInfo.java
...s/platform/rs/website/entity/IndustryApplicationInfo.java
+5
-0
OrderInfoBiz.java
...java/com/upyuns/platform/rs/website/biz/OrderInfoBiz.java
+2
-2
ConfirmOrderService.java
...yuns/platform/rs/website/service/ConfirmOrderService.java
+72
-77
No files found.
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/IndustryApplicationInfo.java
View file @
51a75a1f
...
@@ -149,6 +149,11 @@ public class IndustryApplicationInfo implements Serializable {
...
@@ -149,6 +149,11 @@ public class IndustryApplicationInfo implements Serializable {
*/
*/
private
BigDecimal
price
;
private
BigDecimal
price
;
/**
* 源文件路径
*/
private
String
sourceFile
;
@Transient
@Transient
private
String
firstTitle
;
private
String
firstTitle
;
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/OrderInfoBiz.java
View file @
51a75a1f
...
@@ -282,7 +282,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
...
@@ -282,7 +282,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
switch
(
OrderTypeEnum
.
getByCode
(
itemInfoDto
.
getType
()))
{
switch
(
OrderTypeEnum
.
getByCode
(
itemInfoDto
.
getType
()))
{
//标准数据
//标准数据
case
STANDARD_DATA:
case
STANDARD_DATA:
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
orderInfoDto
.
getDetail
Id
()
+
""
).
getData
();
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
itemInfoDto
.
get
Id
()
+
""
).
getData
();
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
ImageDataVO
imageDataVO
=
imageDataVOList
.
get
(
0
);
ImageDataVO
imageDataVO
=
imageDataVOList
.
get
(
0
);
OrderItem
orderItem
=
new
OrderItem
();
OrderItem
orderItem
=
new
OrderItem
();
...
@@ -364,7 +364,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
...
@@ -364,7 +364,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
//下单后删除购物车
//下单后删除购物车
shoppingCartInfo
.
setIsDel
(
1
);
shoppingCartInfo
.
setIsDel
(
1
);
shoppingCartInfoBiz
.
updateSelectiveByIdR
e
(
shoppingCartInfo
);
shoppingCartInfoBiz
.
delet
e
(
shoppingCartInfo
);
}
}
break
;
break
;
default
:
default
:
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/service/ConfirmOrderService.java
View file @
51a75a1f
...
@@ -54,6 +54,7 @@ public class ConfirmOrderService {
...
@@ -54,6 +54,7 @@ public class ConfirmOrderService {
/**
/**
* 确认订单
* 确认订单
*
* @param confirmOrderDto
* @param confirmOrderDto
* @return
* @return
*/
*/
...
@@ -68,92 +69,86 @@ public class ConfirmOrderService {
...
@@ -68,92 +69,86 @@ public class ConfirmOrderService {
AtomicReference
<
Integer
>
number
=
new
AtomicReference
<>(
0
);
AtomicReference
<
Integer
>
number
=
new
AtomicReference
<>(
0
);
AtomicReference
<
Double
>
amount
=
new
AtomicReference
<>((
double
)
0
);
AtomicReference
<
Double
>
amount
=
new
AtomicReference
<>((
double
)
0
);
itemInfoDtoList
.
parallelStream
().
forEach
(
itemInfoDto
->
{
itemInfoDtoList
.
parallelStream
().
forEach
(
itemInfoDto
->
{
switch
(
OrderTypeEnum
.
getByCode
(
itemInfoDto
.
getType
()))
{
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
STANDARD_DATA
.
getType
()))
{
//标准数据
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
itemInfoDto
.
getId
()
+
""
).
getData
();
case
STANDARD_DATA:
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
itemInfoDto
.
getId
()
+
""
).
getData
();
ImageDataVO
imageDataVO
=
imageDataVOList
.
get
(
0
);
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
ImageDataVO
imageDataVO
=
imageDataVOList
.
get
(
0
);
itemInfoVo
.
setId
(
Long
.
valueOf
(
imageDataVO
.
getId
()));
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
imageDataVO
));
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setPrice
(
imageDataVO
.
getPrice
());
itemInfoVoList
.
add
(
itemInfoVo
);
//总数量
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
imageDataVO
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
}
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
INDUSTRY_INFO
.
getType
()))
{
IndustryApplicationInfo
industryApplicationInfo
=
industryApplicationInfoBiz
.
getOneById
(
itemInfoDto
.
getId
().
intValue
()).
getData
();
if
(
industryApplicationInfo
!=
null
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
Long
.
valueOf
(
industryApplicationInfo
.
getId
()));
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
industryApplicationInfo
));
itemInfoVo
.
setImg
(
industryApplicationInfo
.
getCoverImg
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setPrice
(
industryApplicationInfo
.
getPrice
());
itemInfoVo
.
setName
(
industryApplicationInfo
.
getTitle
());
itemInfoVoList
.
add
(
itemInfoVo
);
//总数量
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
industryApplicationInfo
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
}
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
IMAGE_STORAGE
.
getType
()))
{
ImageInfoRelation
imageInfoRelation
=
imageInfoRelationBiz
.
selectById
(
itemInfoDto
.
getId
());
if
(
imageInfoRelation
!=
null
)
{
ImageImgStorage
imageImgStorage
=
imageImgStorageBiz
.
getDetail
(
itemInfoDto
.
getId
().
intValue
()).
getData
();
if
(
imageImgStorage
!=
null
)
{
List
<
ImageInfoRelation
>
imageInfoRelationList
=
new
ArrayList
<>();
imageInfoRelationList
.
add
(
imageInfoRelation
);
imageImgStorage
.
setImageInfoRelationList
(
imageInfoRelationList
);
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
Long
.
valueOf
(
imageDataVO
.
getId
()));
itemInfoVo
.
setId
(
Long
.
valueOf
(
imageImgStorage
.
getId
()));
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
imageDataVO
));
itemInfoVo
.
setPrice
(
imageInfoRelation
.
getPrice
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setPrice
(
imageDataVO
.
getPrice
());
itemInfoVoList
.
add
(
itemInfoVo
);
//总数量
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
imageDataVO
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
break
;
//行业应用
case
INDUSTRY_INFO:
IndustryApplicationInfo
industryApplicationInfo
=
industryApplicationInfoBiz
.
getOneById
(
itemInfoDto
.
getId
().
intValue
()).
getData
();
if
(
industryApplicationInfo
!=
null
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
Long
.
valueOf
(
industryApplicationInfo
.
getId
()));
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
industryApplicationInfo
));
itemInfoVo
.
setImg
(
industryApplicationInfo
.
getCoverImg
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
set
Type
(
itemInfoDto
.
getType
());
itemInfoVo
.
set
Img
(
imageImgStorage
.
getCoverImg
());
itemInfoVo
.
set
Price
(
industryApplicationInfo
.
getPrice
(
));
itemInfoVo
.
set
DetailJson
(
JSONObject
.
toJSONString
(
imageImgStorage
));
itemInfoVo
.
setName
(
i
ndustryApplicationInfo
.
getTitl
e
());
itemInfoVo
.
setName
(
i
mageImgStorage
.
getNam
e
());
itemInfoVoList
.
add
(
itemInfoVo
);
itemInfoVoList
.
add
(
itemInfoVo
);
//总数量
//总数量
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
industryApplicationInfo
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
BigDecimal
totalAmount
=
imageInfoRelation
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
break
;
//影像图库
case
IMAGE_STORAGE:
ImageInfoRelation
imageInfoRelation
=
imageInfoRelationBiz
.
selectById
(
itemInfoDto
.
getId
());
if
(
imageInfoRelation
!=
null
)
{
ImageImgStorage
imageImgStorage
=
imageImgStorageBiz
.
getDetail
(
itemInfoDto
.
getId
().
intValue
()).
getData
();
if
(
imageImgStorage
!=
null
)
{
List
<
ImageInfoRelation
>
imageInfoRelationList
=
new
ArrayList
<>();
imageInfoRelationList
.
add
(
imageInfoRelation
);
imageImgStorage
.
setImageInfoRelationList
(
imageInfoRelationList
);
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
Long
.
valueOf
(
imageImgStorage
.
getId
()));
itemInfoVo
.
setPrice
(
imageInfoRelation
.
getPrice
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setImg
(
imageImgStorage
.
getCoverImg
());
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
imageImgStorage
));
itemInfoVo
.
setName
(
imageImgStorage
.
getName
());
itemInfoVoList
.
add
(
itemInfoVo
);
//总数量
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
imageInfoRelation
.
getPrice
().
multiply
(
new
BigDecimal
(
itemInfoDto
.
getNumber
()));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
}
break
;
//购物车
case
SHOPPING_CART_INFO:
ShoppingCartInfo
shoppingCartInfo
=
shoppingCartInfoBiz
.
selectById
(
itemInfoDto
.
getId
());
if
(
shoppingCartInfo
!=
null
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
shoppingCartInfo
.
getCartId
());
itemInfoVo
.
setPrice
(
shoppingCartInfo
.
getPrice
());
itemInfoVo
.
setType
(
shoppingCartInfo
.
getType
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setImg
(
shoppingCartInfo
.
getItemPic
());
itemInfoVo
.
setDetailJson
(
shoppingCartInfo
.
getDetailJson
());
itemInfoVo
.
setName
(
shoppingCartInfo
.
getName
());
itemInfoVoList
.
add
(
itemInfoVo
);
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
shoppingCartInfo
.
getTotalAmount
();
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
}
break
;
}
default
:
}
break
;
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
SHOPPING_CART_INFO
.
getType
()))
{
ShoppingCartInfo
shoppingCartInfo
=
shoppingCartInfoBiz
.
selectOne
(
new
ShoppingCartInfo
(){{
setCartId
(
itemInfoDto
.
getId
());}});
if
(
shoppingCartInfo
!=
null
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
shoppingCartInfo
.
getCartId
());
itemInfoVo
.
setPrice
(
shoppingCartInfo
.
getPrice
());
itemInfoVo
.
setType
(
shoppingCartInfo
.
getType
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setImg
(
shoppingCartInfo
.
getItemPic
());
itemInfoVo
.
setDetailJson
(
shoppingCartInfo
.
getDetailJson
());
itemInfoVo
.
setName
(
shoppingCartInfo
.
getName
());
itemInfoVoList
.
add
(
itemInfoVo
);
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
shoppingCartInfo
.
getTotalAmount
();
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
}
}
});
});
confirmOrderInfoVo
.
setTotalAmount
(
new
BigDecimal
(
amount
.
get
()));
confirmOrderInfoVo
.
setTotalAmount
(
new
BigDecimal
(
amount
.
get
())
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
);
confirmOrderInfoVo
.
setNumber
(
number
.
get
());
confirmOrderInfoVo
.
setNumber
(
number
.
get
());
confirmOrderInfoVo
.
setItemInfoVoList
(
itemInfoVoList
);
confirmOrderInfoVo
.
setItemInfoVoList
(
itemInfoVoList
);
}
}
...
@@ -164,7 +159,7 @@ public class ConfirmOrderService {
...
@@ -164,7 +159,7 @@ public class ConfirmOrderService {
confirmOrderInfoVo
.
setFee
(
new
BigDecimal
(
dictionary
.
getDetail
()));
confirmOrderInfoVo
.
setFee
(
new
BigDecimal
(
dictionary
.
getDetail
()));
}
}
if
(
confirmOrderInfoVo
.
getFee
()
!=
null
)
{
if
(
confirmOrderInfoVo
.
getFee
()
!=
null
)
{
confirmOrderInfoVo
.
setActAmount
(
confirmOrderInfoVo
.
getTotalAmount
().
add
(
confirmOrderInfoVo
.
getFee
()));
confirmOrderInfoVo
.
setActAmount
(
confirmOrderInfoVo
.
getTotalAmount
().
add
(
confirmOrderInfoVo
.
getFee
())
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
);
}
}
return
ObjectRestResponse
.
succ
(
confirmOrderInfoVo
);
return
ObjectRestResponse
.
succ
(
confirmOrderInfoVo
);
}
}
...
...
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