Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
cd582e46
Commit
cd582e46
authored
Jun 15, 2020
by
chongfu.liang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1.9.26-订单和购物车的所有直接查数据库的地方添加缓存'
# Conflicts: # order-application-service/pom.xml
parents
7e251253
bba72a4b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
order-application-service/pom.xml
+1
-1
order-application-service/src/main/java/cn/freemud/service/impl/BuriedPointServiceImpl.java
+4
-2
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+10
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuriedPointServiceImpl.java
+10
-6
No files found.
order-application-service/pom.xml
View file @
cd582e46
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<dependency>
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<groupId>
com.freemud.application.service.sdk
</groupId>
<artifactId>
productcenter-sdk
</artifactId>
<artifactId>
productcenter-sdk
</artifactId>
<version>
2.
8.4-SNAPSHOT
</version>
<version>
2.
6.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<artifactId>
membercenter-sdk
</artifactId>
<artifactId>
membercenter-sdk
</artifactId>
...
...
order-application-service/src/main/java/cn/freemud/service/impl/BuriedPointServiceImpl.java
View file @
cd582e46
...
@@ -11,7 +11,9 @@ import cn.freemud.redis.RedisCache;
...
@@ -11,7 +11,9 @@ import cn.freemud.redis.RedisCache;
import
cn.freemud.service.BuriedPointService
;
import
cn.freemud.service.BuriedPointService
;
import
cn.freemud.service.thirdparty.SyncTxProductClient
;
import
cn.freemud.service.thirdparty.SyncTxProductClient
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIappWxappConfig
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformWxapp
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformWxapp
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIappWxappConfigManager
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -58,7 +60,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -58,7 +60,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
@Autowired
@Autowired
private
AssortmentOpenPlatformWxappManager
openPlatformWxappManager
;
private
AssortmentOpenPlatformWxappManager
openPlatformWxappManager
;
@Autowired
@Autowired
private
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
private
Assortment
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
@Override
@Override
public
BaseResponse
BuriedPointPayment
(
BuriedPointPaymentRequestDto
requestDto
,
QueryOrdersResponseDto
.
DataBean
.
OrderBean
orderBean
)
{
public
BaseResponse
BuriedPointPayment
(
BuriedPointPaymentRequestDto
requestDto
,
QueryOrdersResponseDto
.
DataBean
.
OrderBean
orderBean
)
{
...
@@ -158,7 +160,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -158,7 +160,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
* @return
* @return
*/
*/
public
Boolean
getGustLikeStatus
(
String
wxAppId
)
{
public
Boolean
getGustLikeStatus
(
String
wxAppId
)
{
OpenPlatformIappWxappConfig
wxappConfig
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
wxAppId
);
Assortment
OpenPlatformIappWxappConfig
wxappConfig
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
wxAppId
);
if
(
null
!=
wxappConfig
&&
GuessLikeStatus
.
OPEN
.
getCode
().
equals
(
wxappConfig
.
getGuessLikeStatus
()))
{
if
(
null
!=
wxappConfig
&&
GuessLikeStatus
.
OPEN
.
getCode
().
equals
(
wxappConfig
.
getGuessLikeStatus
()))
{
return
true
;
return
true
;
}
}
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
cd582e46
...
@@ -34,7 +34,11 @@ import cn.freemud.service.thirdparty.ShoppingCartClient;
...
@@ -34,7 +34,11 @@ import cn.freemud.service.thirdparty.ShoppingCartClient;
import
cn.freemud.service.thirdparty.StockClient
;
import
cn.freemud.service.thirdparty.StockClient
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIappWxappConfig
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerStoreDeliveryConfig
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIappWxappConfigManager
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.application.sdk.api.base.BaseResponse
;
import
com.freemud.application.sdk.api.base.BaseResponse
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
...
@@ -74,9 +78,9 @@ public class CheckOrder {
...
@@ -74,9 +78,9 @@ public class CheckOrder {
@Autowired
@Autowired
private
StoreTableNumberManager
storeTableNumberManager
;
private
StoreTableNumberManager
storeTableNumberManager
;
@Autowired
@Autowired
private
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
private
Assortment
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
@Autowired
@Autowired
private
OpenPlatformPartnerStoreDeliveryConfigManager
deliveryConfigManager
;
private
Assortment
OpenPlatformPartnerStoreDeliveryConfigManager
deliveryConfigManager
;
// 缓存取用户数据用
// 缓存取用户数据用
// @Autowired
// @Autowired
// private UserServiceImpl userService;
// private UserServiceImpl userService;
...
@@ -207,7 +211,7 @@ public class CheckOrder {
...
@@ -207,7 +211,7 @@ public class CheckOrder {
String
appId
=
userLoginInfoDto
.
getWxAppId
();
String
appId
=
userLoginInfoDto
.
getWxAppId
();
// 校验小程序是否支持到店或者外卖
// 校验小程序是否支持到店或者外卖
OpenPlatformIappWxappConfig
config
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
appId
);
Assortment
OpenPlatformIappWxappConfig
config
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
appId
);
// 自提校验
// 自提校验
if
(
CreateOrderType
.
COLLECT_GOODS
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
CreateOrderType
.
COLLECT_GOODS
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
config
==
null
||
config
.
getTakeInside
()
==
null
||
config
.
getTakeInside
()
!=
1
)
{
if
(
config
==
null
||
config
.
getTakeInside
()
==
null
||
config
.
getTakeInside
()
!=
1
)
{
...
@@ -359,13 +363,13 @@ public class CheckOrder {
...
@@ -359,13 +363,13 @@ public class CheckOrder {
* 获取门店配送信息
* 获取门店配送信息
*/
*/
public
StoreDeliveryInfoDto
getStoreDeliveryInfo
(
StoreResponse
.
BizVO
storeResponseDto
,
public
StoreDeliveryInfoDto
getStoreDeliveryInfo
(
StoreResponse
.
BizVO
storeResponseDto
,
OpenPlatformIappWxappConfig
openPlatformIappWxappConfig
,
String
wxAppid
)
{
Assortment
OpenPlatformIappWxappConfig
openPlatformIappWxappConfig
,
String
wxAppid
)
{
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
new
StoreDeliveryInfoDto
();
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
new
StoreDeliveryInfoDto
();
storeDeliveryInfoDto
.
setPartnerId
(
storeResponseDto
.
getPartnerId
());
storeDeliveryInfoDto
.
setPartnerId
(
storeResponseDto
.
getPartnerId
());
storeDeliveryInfoDto
.
setStoreId
(
storeResponseDto
.
getStoreCode
());
storeDeliveryInfoDto
.
setStoreId
(
storeResponseDto
.
getStoreCode
());
storeDeliveryInfoDto
.
setStoreName
(
storeResponseDto
.
getStoreName
());
storeDeliveryInfoDto
.
setStoreName
(
storeResponseDto
.
getStoreName
());
// 查询外卖配送信息
// 查询外卖配送信息
OpenPlatformPartnerStoreDeliveryConfig
deliveryConfig
=
deliveryConfigManager
.
findByPartnerIdAndStoreCode
(
storeResponseDto
.
getPartnerId
(),
Assortment
OpenPlatformPartnerStoreDeliveryConfig
deliveryConfig
=
deliveryConfigManager
.
findByPartnerIdAndStoreCode
(
storeResponseDto
.
getPartnerId
(),
storeResponseDto
.
getStoreCode
());
storeResponseDto
.
getStoreCode
());
if
(
deliveryConfig
==
null
)
{
if
(
deliveryConfig
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
STORE_ITEM_NOT_DELIVERY
);
throw
new
ServiceException
(
ResponseResult
.
STORE_ITEM_NOT_DELIVERY
);
...
@@ -409,7 +413,7 @@ public class CheckOrder {
...
@@ -409,7 +413,7 @@ public class CheckOrder {
* 获取门店配送信息
* 获取门店配送信息
*/
*/
public
StoreDeliveryInfoDto
getNewStoreDeliveryInfo
(
StoreResponse
.
BizVO
storeResponseDto
,
public
StoreDeliveryInfoDto
getNewStoreDeliveryInfo
(
StoreResponse
.
BizVO
storeResponseDto
,
OpenPlatformIappWxappConfig
openPlatformIappWxappConfig
,
String
wxAppid
,
String
trackingNo
)
{
Assortment
OpenPlatformIappWxappConfig
openPlatformIappWxappConfig
,
String
wxAppid
,
String
trackingNo
)
{
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
new
StoreDeliveryInfoDto
();
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
new
StoreDeliveryInfoDto
();
storeDeliveryInfoDto
.
setPartnerId
(
storeResponseDto
.
getPartnerId
());
storeDeliveryInfoDto
.
setPartnerId
(
storeResponseDto
.
getPartnerId
());
storeDeliveryInfoDto
.
setStoreId
(
storeResponseDto
.
getStoreCode
());
storeDeliveryInfoDto
.
setStoreId
(
storeResponseDto
.
getStoreCode
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuriedPointServiceImpl.java
View file @
cd582e46
...
@@ -17,6 +17,10 @@ import cn.freemud.service.UserService;
...
@@ -17,6 +17,10 @@ import cn.freemud.service.UserService;
import
cn.freemud.service.thirdparty.SyncTxProductClient
;
import
cn.freemud.service.thirdparty.SyncTxProductClient
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIappWxappConfig
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformWxapp
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIappWxappConfigManager
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -61,9 +65,9 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -61,9 +65,9 @@ public class BuriedPointServiceImpl implements BuriedPointService {
@Autowired
@Autowired
private
RedisCache
redisCache
;
private
RedisCache
redisCache
;
@Autowired
@Autowired
private
OpenPlatformWxappManager
openPlatformWxappManager
;
private
Assortment
OpenPlatformWxappManager
openPlatformWxappManager
;
@Autowired
@Autowired
private
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
private
Assortment
OpenPlatformIappWxappConfigManager
openPlatformIappWxappConfigManager
;
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Async
@Async
...
@@ -77,7 +81,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -77,7 +81,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String
openId
=
(
String
)
map
.
get
(
"openid"
);
String
openId
=
(
String
)
map
.
get
(
"openid"
);
String
wxAppid
=
(
String
)
map
.
get
(
"wxAppid"
);
String
wxAppid
=
(
String
)
map
.
get
(
"wxAppid"
);
if
(
getGustLikeStatus
(
wxAppid
)){
if
(
getGustLikeStatus
(
wxAppid
)){
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
wxAppid
);
Assortment
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
wxAppid
);
BuriedPointRequestDto
dto
=
new
BuriedPointRequestDto
();
BuriedPointRequestDto
dto
=
new
BuriedPointRequestDto
();
dto
.
setVer
(
"1"
);
dto
.
setVer
(
"1"
);
dto
.
setUnifyId
(
shoppingCartRequestDto
.
getPartnerId
());
dto
.
setUnifyId
(
shoppingCartRequestDto
.
getPartnerId
());
...
@@ -160,7 +164,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -160,7 +164,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String
sessionId
=
requestDto
.
getSessionId
();
String
sessionId
=
requestDto
.
getSessionId
();
String
redisKey
=
"saas:user:info:sessionId:"
+
sessionId
;
String
redisKey
=
"saas:user:info:sessionId:"
+
sessionId
;
Map
<
String
,
Object
>
map
=
redisCache
.
getValue
(
redisKey
);
Map
<
String
,
Object
>
map
=
redisCache
.
getValue
(
redisKey
);
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
requestDto
.
getWxAppId
());
Assortment
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
requestDto
.
getWxAppId
());
RequestAttributes
ra
=
RequestContextHolder
.
getRequestAttributes
();
RequestAttributes
ra
=
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
HttpServletRequest
request
=
sra
.
getRequest
();
HttpServletRequest
request
=
sra
.
getRequest
();
...
@@ -257,7 +261,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -257,7 +261,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String
memberId
=
userLoginInfoDto
.
getMemberId
();
String
memberId
=
userLoginInfoDto
.
getMemberId
();
String
openId
=
userLoginInfoDto
.
getOpenId
();
String
openId
=
userLoginInfoDto
.
getOpenId
();
if
(
getGustLikeStatus
(
wxAppId
))
{
if
(
getGustLikeStatus
(
wxAppId
))
{
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
wxAppId
);
Assortment
OpenPlatformWxapp
wxapp
=
openPlatformWxappManager
.
findByWxappId
(
wxAppId
);
RequestAttributes
ra
=
RequestContextHolder
.
getRequestAttributes
();
RequestAttributes
ra
=
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
ra
;
HttpServletRequest
request
=
sra
.
getRequest
();
HttpServletRequest
request
=
sra
.
getRequest
();
...
@@ -345,7 +349,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
...
@@ -345,7 +349,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
* @return
* @return
*/
*/
public
Boolean
getGustLikeStatus
(
String
wxAppId
)
{
public
Boolean
getGustLikeStatus
(
String
wxAppId
)
{
OpenPlatformIappWxappConfig
wxappConfig
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
wxAppId
);
Assortment
OpenPlatformIappWxappConfig
wxappConfig
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
wxAppId
);
if
(
null
!=
wxappConfig
&&
GuessLikeStatus
.
OPEN
.
getCode
().
equals
(
wxappConfig
.
getGuessLikeStatus
()))
{
if
(
null
!=
wxappConfig
&&
GuessLikeStatus
.
OPEN
.
getCode
().
equals
(
wxappConfig
.
getGuessLikeStatus
()))
{
return
true
;
return
true
;
}
}
...
...
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