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
d376c0a8
Commit
d376c0a8
authored
Dec 16, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
72077691
fbcbb56e
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
343 additions
and
7 deletions
+343
-7
DictionaryKey.java
.../upyuns/platform/rs/universal/constant/DictionaryKey.java
+5
-0
ConfirmOrderDto.java
...a/com/upyuns/platform/rs/website/dto/ConfirmOrderDto.java
+17
-0
ItemInfoDto.java
.../java/com/upyuns/platform/rs/website/dto/ItemInfoDto.java
+22
-0
IndustryApplicationInfo.java
...s/platform/rs/website/entity/IndustryApplicationInfo.java
+6
-0
OrderTypeEnum.java
...va/com/upyuns/platform/rs/website/type/OrderTypeEnum.java
+2
-1
ConfirmOrderInfoVo.java
...com/upyuns/platform/rs/website/vo/ConfirmOrderInfoVo.java
+55
-0
ItemInfoVo.java
...in/java/com/upyuns/platform/rs/website/vo/ItemInfoVo.java
+21
-0
ImageImgStorageBiz.java
...om/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
+13
-1
IndustryApplicationInfoBiz.java
...s/platform/rs/website/biz/IndustryApplicationInfoBiz.java
+13
-0
ShoppingCartInfoBiz.java
...m/upyuns/platform/rs/website/biz/ShoppingCartInfoBiz.java
+21
-2
UserAddressBiz.java
...va/com/upyuns/platform/rs/website/biz/UserAddressBiz.java
+1
-1
UserInvoiceBiz.java
...va/com/upyuns/platform/rs/website/biz/UserInvoiceBiz.java
+2
-2
OrderInfoWebController.java
...orm/rs/website/controller/web/OrderInfoWebController.java
+15
-0
ConfirmOrderService.java
...yuns/platform/rs/website/service/ConfirmOrderService.java
+150
-0
No files found.
rs-universal/rs-universal-api/src/main/java/com/upyuns/platform/rs/universal/constant/DictionaryKey.java
View file @
d376c0a8
...
...
@@ -89,4 +89,9 @@ public class DictionaryKey {
* 取消时间缓冲(分钟)
*/
public
static
final
String
CANCEL_TIME_BUFFER
=
"CANCEL_TIME_BUFFER"
;
/**
* 运费
*/
public
static
final
String
SEND_FEE
=
"SEND_FEE"
;
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/dto/ConfirmOrderDto.java
0 → 100644
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @ClassName : ConfirmOrderDto
* @Description : 确认订单
* @Author : jiaoruizhen
* @Date: 2020-12-16 14:51
*/
@Data
public
class
ConfirmOrderDto
{
List
<
ItemInfoDto
>
itemInfoDtoList
;
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/dto/ItemInfoDto.java
0 → 100644
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
dto
;
import
lombok.Data
;
/**
* @ClassName : itemInfoDto
* @Description : 商品信息
* @Author : jiaoruizhen
* @Date: 2020-12-16 16:56
*/
@Data
public
class
ItemInfoDto
{
Integer
id
;
Integer
number
;
/**
* 类型: 1、标准数据,2、影像图库,3、行业应用信息, 4、购物车确认订单
*/
private
Integer
type
;
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/IndustryApplicationInfo.java
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
javax.persistence.*
;
...
...
@@ -143,6 +144,11 @@ public class IndustryApplicationInfo implements Serializable {
*/
private
Integer
customized
;
/**
* 价格信息
*/
private
BigDecimal
price
;
@Transient
private
String
firstTitle
;
...
...
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/type/OrderTypeEnum.java
View file @
d376c0a8
...
...
@@ -9,7 +9,8 @@ package com.upyuns.platform.rs.website.type;
public
enum
OrderTypeEnum
{
STANDARD_DATA
(
1
,
"标准数据"
),
INDUSTRY_INFO
(
3
,
"行业应用"
),
IMAGE_STORAGE
(
2
,
"影像图库"
);
IMAGE_STORAGE
(
2
,
"影像图库"
),
SHOPPING_CART_INFO
(
4
,
"购物车下单"
);
private
Integer
type
;
private
String
msg
;
...
...
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/vo/ConfirmOrderInfoVo.java
0 → 100644
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
vo
;
import
com.upyuns.platform.rs.website.entity.*
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @ClassName : ConfirmOrderInfoVo
* @Description : 确认订单
* @Author : jiaoruizhen
* @Date: 2020-12-16 14:57
*/
@Data
public
class
ConfirmOrderInfoVo
{
/**
* 配送方式:1、线上配送,2、快递配送
*/
private
Integer
sendType
;
/**
* 用户地址列表
*/
private
List
<
UserAddress
>
userAddressList
;
/**
* 用户发票列表
*/
private
List
<
UserInvoice
>
userInvoiceList
;
/**
* 订单商品数量
*/
private
Integer
number
;
/**
* 总金额
*/
private
BigDecimal
totalAmount
;
/**
* 实付金额
*/
private
BigDecimal
actAmount
;
/**
* 运费
*/
private
BigDecimal
fee
;
private
List
<
ItemInfoVo
>
itemInfoVoList
;
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/vo/ItemInfoVo.java
0 → 100644
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @ClassName : ItemInfoVo
* @Description : 商品信息
* @Author : jiaoruizhen
* @Date: 2020-12-16 16:59
*/
@Data
public
class
ItemInfoVo
{
private
Integer
id
;
private
String
detailJson
;
private
Integer
number
;
private
BigDecimal
price
;
private
Integer
type
;
private
String
img
;
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
View file @
d376c0a8
...
...
@@ -17,7 +17,9 @@ import com.upyuns.platform.rs.website.mapper.ImageImgStorageMapper;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
/**
* 影像图库
...
...
@@ -118,7 +120,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
* @param id
* @return
*/
public
ObjectRestResponse
getDetail
(
Integer
id
)
{
public
ObjectRestResponse
<
ImageImgStorage
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
...
...
@@ -147,4 +149,14 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
return
ObjectRestResponse
.
succ
(
mapper
.
selectByExample
(
example
));
}
/**
* 根据ID List 获取所有图库信息
* @param idList
* @return
*/
public
List
<
ImageImgStorage
>
getAllByIds
(
Set
<
Integer
>
idList
)
{
Example
example
=
new
Example
(
ImageImgStorage
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
idList
);
return
mapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/IndustryApplicationInfoBiz.java
View file @
d376c0a8
...
...
@@ -21,6 +21,7 @@ import tk.mybatis.mapper.entity.Example;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -109,4 +110,16 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
}
return
ObjectRestResponse
.
succ
(
list
);
}
/**
* 根据ID List获取行业应用信息
* @param idList
* @return
*/
public
List
<
IndustryApplicationInfo
>
getAllByIds
(
Set
<
Integer
>
idList
)
{
Example
example
=
new
Example
(
IndustryApplicationInfo
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
idList
);
return
mapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ShoppingCartInfoBiz.java
View file @
d376c0a8
...
...
@@ -26,6 +26,7 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
/**
* 购物车
...
...
@@ -35,7 +36,7 @@ import java.util.List;
* @date 2020-12-03 13:29:23
*/
@Service
public
class
ShoppingCartInfoBiz
extends
BaseBiz
<
ShoppingCartInfoMapper
,
ShoppingCartInfo
>
{
public
class
ShoppingCartInfoBiz
extends
BaseBiz
<
ShoppingCartInfoMapper
,
ShoppingCartInfo
>
{
@Autowired
OrderInfoBiz
orderInfoBiz
;
...
...
@@ -57,6 +58,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 添加购物车
*
* @param shoppingCartInfo
* @return
*/
...
...
@@ -76,6 +78,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 获取用户所有购物车商品
*
* @param orderInfoDto
* @return
*/
...
...
@@ -94,6 +97,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 前端用户添加购物车
*
* @param orderInfoDto 商品详情ID
* @return
*/
...
...
@@ -188,6 +192,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 购物车转为订单
*
* @param cartOrderDto
* @return
*/
...
...
@@ -215,11 +220,12 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 购物车转订单实现
*
* @param cartInfoList
*/
private
void
convertToOrderInfo
(
List
<
ShoppingCartInfo
>
cartInfoList
,
CartOrderDto
cartOrderDto
,
AppUserDTO
appUserDTO
)
{
//总金额
double
amount
=
cartInfoList
.
parallelStream
().
mapToDouble
(
shoppingCartInfo
->
shoppingCartInfo
.
getTotalAmount
().
doubleValue
()).
sum
();
double
amount
=
cartInfoList
.
parallelStream
().
mapToDouble
(
shoppingCartInfo
->
shoppingCartInfo
.
getTotalAmount
().
doubleValue
()).
sum
();
//总数量
Integer
totalNumber
=
cartInfoList
.
parallelStream
().
mapToInt
(
ShoppingCartInfo:
:
getNumber
).
sum
();
OrderInfo
orderInfo
=
new
OrderInfo
();
...
...
@@ -248,6 +254,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 删除购物车
*
* @param id
* @return
*/
...
...
@@ -266,6 +273,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
/**
* 批量删除
*
* @param ids
* @return
*/
...
...
@@ -285,4 +293,15 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper,Shopping
return
ObjectRestResponse
.
succ
();
}
/**
* 根据ID List 查询所有购物车信息
* @param idList
* @return
*/
public
List
<
ShoppingCartInfo
>
getAllByIds
(
Set
<
Integer
>
idList
)
{
Example
example
=
new
Example
(
ShoppingCartInfo
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
idList
);
return
mapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/UserAddressBiz.java
View file @
d376c0a8
...
...
@@ -93,7 +93,7 @@ public class UserAddressBiz extends BaseBiz<UserAddressMapper, UserAddress> {
*
* @return
*/
public
ObjectRestResponse
getUserAddress
(
UserAddressDto
userAddressDto
)
{
public
ObjectRestResponse
<
PageDataVO
<
UserAddress
>>
getUserAddress
(
UserAddressDto
userAddressDto
)
{
AppUserDTO
appUserVo
=
userFeign
.
userDetailByToken
(
request
.
getHeader
(
"Authorization"
)).
getData
();
if
(
appUserVo
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/UserInvoiceBiz.java
View file @
d376c0a8
...
...
@@ -104,7 +104,7 @@ public class UserInvoiceBiz extends BaseBiz<UserInvoiceMapper,UserInvoice> {
* @param userInvoiceDto
* @return
*/
public
ObjectRestResponse
getList
(
UserInvoiceDto
userInvoiceDto
)
{
public
ObjectRestResponse
<
PageDataVO
<
UserInvoice
>>
getList
(
UserInvoiceDto
userInvoiceDto
)
{
Example
example
=
new
Example
(
UserInvoice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
userInvoiceDto
.
getUserId
()
!=
null
)
{
...
...
@@ -131,7 +131,7 @@ public class UserInvoiceBiz extends BaseBiz<UserInvoiceMapper,UserInvoice> {
* @param userInvoiceDto
* @return
*/
public
ObjectRestResponse
getUserInvoiceInfo
(
UserInvoiceDto
userInvoiceDto
)
{
public
ObjectRestResponse
<
PageDataVO
<
UserInvoice
>>
getUserInvoiceInfo
(
UserInvoiceDto
userInvoiceDto
)
{
AppUserDTO
appUserDTO
=
userFeign
.
userDetailByToken
(
request
.
getHeader
(
"Authorization"
)).
getData
();
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/web/OrderInfoWebController.java
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
controller
.
web
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.upyuns.platform.rs.website.biz.OrderInfoBiz
;
import
com.upyuns.platform.rs.website.dto.ConfirmOrderDto
;
import
com.upyuns.platform.rs.website.entity.OrderInfo
;
import
com.upyuns.platform.rs.website.service.ConfirmOrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -10,4 +16,13 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"orderInfo/web"
)
public
class
OrderInfoWebController
extends
BaseController
<
OrderInfoBiz
,
OrderInfo
>
{
@Autowired
ConfirmOrderService
confirmOrderService
;
@PostMapping
(
value
=
"confirmOrder"
)
public
ObjectRestResponse
confirmOrder
(
@RequestBody
ConfirmOrderDto
confirmOrderDto
)
{
return
confirmOrderService
.
confirmOrderInfo
(
confirmOrderDto
);
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/service/ConfirmOrderService.java
0 → 100644
View file @
d376c0a8
package
com
.
upyuns
.
platform
.
rs
.
website
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.upyuns.platform.rs.universal.constant.DictionaryKey
;
import
com.upyuns.platform.rs.universal.entity.Dictionary
;
import
com.upyuns.platform.rs.universal.feign.ThirdFeign
;
import
com.upyuns.platform.rs.website.biz.*
;
import
com.upyuns.platform.rs.website.dto.ConfirmOrderDto
;
import
com.upyuns.platform.rs.website.dto.ItemInfoDto
;
import
com.upyuns.platform.rs.website.entity.*
;
import
com.upyuns.platform.rs.website.type.OrderTypeEnum
;
import
com.upyuns.platform.rs.website.vo.ConfirmOrderInfoVo
;
import
com.upyuns.platform.rs.website.vo.ItemInfoVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
/**
* @ClassName : ConfirmOrderService
* @Description : 确认订单信息
* @Author : jiaoruizhen
* @Date: 2020-12-16 14:50
*/
@Service
@Slf4j
public
class
ConfirmOrderService
{
@Autowired
IndustryApplicationInfoBiz
industryApplicationInfoBiz
;
@Autowired
ImageImgStorageBiz
imageImgStorageBiz
;
@Autowired
ShoppingCartInfoBiz
shoppingCartInfoBiz
;
@Autowired
ImageInfoRelationBiz
imageInfoRelationBiz
;
@Autowired
ThirdFeign
thirdFeign
;
/**
* 确认订单
* @param confirmOrderDto
* @return
*/
public
ObjectRestResponse
confirmOrderInfo
(
ConfirmOrderDto
confirmOrderDto
)
{
if
(
confirmOrderDto
==
null
||
confirmOrderDto
.
getItemInfoDtoList
()
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
ConfirmOrderInfoVo
confirmOrderInfoVo
=
new
ConfirmOrderInfoVo
();
List
<
ItemInfoDto
>
itemInfoDtoList
=
confirmOrderDto
.
getItemInfoDtoList
();
if
(
itemInfoDtoList
!=
null
&&
itemInfoDtoList
.
size
()
>
0
)
{
List
<
ItemInfoVo
>
itemInfoVoList
=
new
ArrayList
<>();
AtomicReference
<
Integer
>
number
=
new
AtomicReference
<>(
0
);
AtomicReference
<
Double
>
amount
=
new
AtomicReference
<>((
double
)
0
);
itemInfoDtoList
.
parallelStream
().
forEach
(
itemInfoDto
->
{
switch
(
OrderTypeEnum
.
getByCode
(
itemInfoDto
.
getType
()))
{
//标准数据
case
STANDARD_DATA:
break
;
//行业应用
case
INDUSTRY_INFO:
IndustryApplicationInfo
industryApplicationInfo
=
industryApplicationInfoBiz
.
getOneById
(
itemInfoDto
.
getId
()).
getData
();
if
(
industryApplicationInfo
!=
null
)
{
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
industryApplicationInfo
.
getId
());
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
industryApplicationInfo
));
itemInfoVo
.
setImg
(
industryApplicationInfo
.
getCoverImg
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setPrice
(
industryApplicationInfo
.
getPrice
());
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
())));
}
break
;
//影像图库
case
IMAGE_STORAGE:
ImageInfoRelation
imageInfoRelation
=
imageInfoRelationBiz
.
selectById
(
itemInfoDto
.
getId
());
if
(
imageInfoRelation
!=
null
)
{
ImageImgStorage
imageImgStorage
=
imageImgStorageBiz
.
getDetail
(
itemInfoDto
.
getId
()).
getData
();
if
(
imageImgStorage
!=
null
)
{
List
<
ImageInfoRelation
>
imageInfoRelationList
=
new
ArrayList
<>();
imageInfoRelationList
.
add
(
imageInfoRelation
);
imageImgStorage
.
setImageInfoRelationList
(
imageInfoRelationList
);
ItemInfoVo
itemInfoVo
=
new
ItemInfoVo
();
itemInfoVo
.
setId
(
imageImgStorage
.
getId
());
itemInfoVo
.
setPrice
(
imageInfoRelation
.
getPrice
());
itemInfoVo
.
setType
(
itemInfoDto
.
getType
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setImg
(
imageImgStorage
.
getCoverImg
());
itemInfoVo
.
setDetailJson
(
JSONObject
.
toJSONString
(
imageImgStorage
));
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
().
intValue
());
itemInfoVo
.
setPrice
(
shoppingCartInfo
.
getPrice
());
itemInfoVo
.
setType
(
shoppingCartInfo
.
getType
());
itemInfoVo
.
setNumber
(
itemInfoDto
.
getNumber
());
itemInfoVo
.
setImg
(
shoppingCartInfo
.
getItemPic
());
itemInfoVo
.
setDetailJson
(
shoppingCartInfo
.
getDetailJson
());
itemInfoVoList
.
add
(
itemInfoVo
);
number
.
updateAndGet
(
v
->
v
+
itemInfoDto
.
getNumber
());
BigDecimal
totalAmount
=
shoppingCartInfo
.
getTotalAmount
();
amount
.
updateAndGet
(
v
->
new
Double
((
double
)
(
v
+
totalAmount
.
doubleValue
())));
}
break
;
default
:
break
;
}
});
confirmOrderInfoVo
.
setTotalAmount
(
new
BigDecimal
(
amount
.
get
()));
confirmOrderInfoVo
.
setNumber
(
number
.
get
());
confirmOrderInfoVo
.
setItemInfoVoList
(
itemInfoVoList
);
}
Dictionary
dictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
DictionaryKey
.
APP_ORDER
,
DictionaryKey
.
SEND_FEE
);
if
(
dictionary
!=
null
&&
StringUtils
.
isNotBlank
(
dictionary
.
getDetail
()))
{
confirmOrderInfoVo
.
setFee
(
new
BigDecimal
(
dictionary
.
getDetail
()));
}
if
(
confirmOrderInfoVo
.
getFee
()
!=
null
)
{
confirmOrderInfoVo
.
setActAmount
(
confirmOrderInfoVo
.
getTotalAmount
().
add
(
confirmOrderInfoVo
.
getFee
()));
}
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