Commit cd582e46 by chongfu.liang

Merge branch 'feature/1.9.26-订单和购物车的所有直接查数据库的地方添加缓存'

# Conflicts:
#	order-application-service/pom.xml
parents 7e251253 bba72a4b
...@@ -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>
......
...@@ -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 AssortmentOpenPlatformIappWxappConfigManager 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); AssortmentOpenPlatformIappWxappConfig 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;
} }
......
...@@ -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 AssortmentOpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
@Autowired @Autowired
private OpenPlatformPartnerStoreDeliveryConfigManager deliveryConfigManager; private AssortmentOpenPlatformPartnerStoreDeliveryConfigManager 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); AssortmentOpenPlatformIappWxappConfig 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) { AssortmentOpenPlatformIappWxappConfig 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(), AssortmentOpenPlatformPartnerStoreDeliveryConfig 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) { AssortmentOpenPlatformIappWxappConfig 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());
......
...@@ -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 AssortmentOpenPlatformWxappManager openPlatformWxappManager;
@Autowired @Autowired
private OpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager; private AssortmentOpenPlatformIappWxappConfigManager 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); AssortmentOpenPlatformWxapp 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()); AssortmentOpenPlatformWxapp 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); AssortmentOpenPlatformWxapp 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); AssortmentOpenPlatformIappWxappConfig 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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment