Commit cd582e46 by chongfu.liang

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

# Conflicts:
#	order-application-service/pom.xml
parents 7e251253 bba72a4b
......@@ -45,7 +45,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>productcenter-sdk</artifactId>
<version>2.8.4-SNAPSHOT</version>
<version>2.6.RELEASE</version>
</dependency>
<dependency>
<artifactId>membercenter-sdk</artifactId>
......
......@@ -11,7 +11,9 @@ import cn.freemud.redis.RedisCache;
import cn.freemud.service.BuriedPointService;
import cn.freemud.service.thirdparty.SyncTxProductClient;
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.manager.AssortmentOpenPlatformIappWxappConfigManager;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
......@@ -58,7 +60,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
@Autowired
private AssortmentOpenPlatformWxappManager openPlatformWxappManager;
@Autowired
private OpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
private AssortmentOpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
@Override
public BaseResponse BuriedPointPayment(BuriedPointPaymentRequestDto requestDto, QueryOrdersResponseDto.DataBean.OrderBean orderBean) {
......@@ -158,7 +160,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
* @return
*/
public Boolean getGustLikeStatus(String wxAppId) {
OpenPlatformIappWxappConfig wxappConfig = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(wxAppId);
AssortmentOpenPlatformIappWxappConfig wxappConfig = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(wxAppId);
if (null != wxappConfig && GuessLikeStatus.OPEN.getCode().equals(wxappConfig.getGuessLikeStatus())) {
return true;
}
......
......@@ -34,7 +34,11 @@ import cn.freemud.service.thirdparty.ShoppingCartClient;
import cn.freemud.service.thirdparty.StockClient;
import cn.freemud.utils.LogUtil;
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.manager.AssortmentOpenPlatformIappWxappConfigManager;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.base.BaseResponse;
import com.freemud.application.sdk.api.log.LogThreadLocal;
......@@ -74,9 +78,9 @@ public class CheckOrder {
@Autowired
private StoreTableNumberManager storeTableNumberManager;
@Autowired
private OpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
private AssortmentOpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
@Autowired
private OpenPlatformPartnerStoreDeliveryConfigManager deliveryConfigManager;
private AssortmentOpenPlatformPartnerStoreDeliveryConfigManager deliveryConfigManager;
// 缓存取用户数据用
// @Autowired
// private UserServiceImpl userService;
......@@ -207,7 +211,7 @@ public class CheckOrder {
String appId = userLoginInfoDto.getWxAppId();
// 校验小程序是否支持到店或者外卖
OpenPlatformIappWxappConfig config = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(appId);
AssortmentOpenPlatformIappWxappConfig config = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(appId);
// 自提校验
if (CreateOrderType.COLLECT_GOODS.getCode().equals(createOrderVo.getOrderType())) {
if (config == null || config.getTakeInside() == null || config.getTakeInside() != 1) {
......@@ -359,13 +363,13 @@ public class CheckOrder {
* 获取门店配送信息
*/
public StoreDeliveryInfoDto getStoreDeliveryInfo(StoreResponse.BizVO storeResponseDto,
OpenPlatformIappWxappConfig openPlatformIappWxappConfig, String wxAppid) {
AssortmentOpenPlatformIappWxappConfig openPlatformIappWxappConfig, String wxAppid) {
StoreDeliveryInfoDto storeDeliveryInfoDto = new StoreDeliveryInfoDto();
storeDeliveryInfoDto.setPartnerId(storeResponseDto.getPartnerId());
storeDeliveryInfoDto.setStoreId(storeResponseDto.getStoreCode());
storeDeliveryInfoDto.setStoreName(storeResponseDto.getStoreName());
// 查询外卖配送信息
OpenPlatformPartnerStoreDeliveryConfig deliveryConfig = deliveryConfigManager.findByPartnerIdAndStoreCode(storeResponseDto.getPartnerId(),
AssortmentOpenPlatformPartnerStoreDeliveryConfig deliveryConfig = deliveryConfigManager.findByPartnerIdAndStoreCode(storeResponseDto.getPartnerId(),
storeResponseDto.getStoreCode());
if (deliveryConfig == null) {
throw new ServiceException(ResponseResult.STORE_ITEM_NOT_DELIVERY);
......@@ -409,7 +413,7 @@ public class CheckOrder {
* 获取门店配送信息
*/
public StoreDeliveryInfoDto getNewStoreDeliveryInfo(StoreResponse.BizVO storeResponseDto,
OpenPlatformIappWxappConfig openPlatformIappWxappConfig, String wxAppid, String trackingNo) {
AssortmentOpenPlatformIappWxappConfig openPlatformIappWxappConfig, String wxAppid, String trackingNo) {
StoreDeliveryInfoDto storeDeliveryInfoDto = new StoreDeliveryInfoDto();
storeDeliveryInfoDto.setPartnerId(storeResponseDto.getPartnerId());
storeDeliveryInfoDto.setStoreId(storeResponseDto.getStoreCode());
......
......@@ -17,6 +17,10 @@ import cn.freemud.service.UserService;
import cn.freemud.service.thirdparty.SyncTxProductClient;
import cn.freemud.utils.LogUtil;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -61,9 +65,9 @@ public class BuriedPointServiceImpl implements BuriedPointService {
@Autowired
private RedisCache redisCache;
@Autowired
private OpenPlatformWxappManager openPlatformWxappManager;
private AssortmentOpenPlatformWxappManager openPlatformWxappManager;
@Autowired
private OpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
private AssortmentOpenPlatformIappWxappConfigManager openPlatformIappWxappConfigManager;
@Autowired
private UserService userService;
@Async
......@@ -77,7 +81,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String openId = (String) map.get("openid");
String wxAppid = (String) map.get("wxAppid");
if(getGustLikeStatus(wxAppid)){
OpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(wxAppid);
AssortmentOpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(wxAppid);
BuriedPointRequestDto dto = new BuriedPointRequestDto();
dto.setVer("1");
dto.setUnifyId(shoppingCartRequestDto.getPartnerId());
......@@ -160,7 +164,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String sessionId = requestDto.getSessionId();
String redisKey = "saas:user:info:sessionId:" + sessionId;
Map<String, Object> map = redisCache.getValue(redisKey);
OpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(requestDto.getWxAppId());
AssortmentOpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(requestDto.getWxAppId());
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
......@@ -257,7 +261,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
String memberId = userLoginInfoDto.getMemberId();
String openId = userLoginInfoDto.getOpenId();
if (getGustLikeStatus(wxAppId)) {
OpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(wxAppId);
AssortmentOpenPlatformWxapp wxapp = openPlatformWxappManager.findByWxappId(wxAppId);
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
......@@ -345,7 +349,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
* @return
*/
public Boolean getGustLikeStatus(String wxAppId) {
OpenPlatformIappWxappConfig wxappConfig = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(wxAppId);
AssortmentOpenPlatformIappWxappConfig wxappConfig = openPlatformIappWxappConfigManager.selectIappWxappConfigByWxAppId(wxAppId);
if (null != wxappConfig && GuessLikeStatus.OPEN.getCode().equals(wxappConfig.getGuessLikeStatus())) {
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