| @@ -1,9 +1,6 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.iformall.domain.po.PushLimit; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.po.WxScoreRules; | |||||
| import com.iformall.domain.po.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.cache.CacheManager; | import org.springframework.cache.CacheManager; | ||||
| @@ -122,4 +119,21 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("buserTokenRedisTemplate") | |||||
| public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxBuser> template = new RedisTemplate(); | |||||
| Jackson2JsonRedisSerializer<WxBuser> j = new Jackson2JsonRedisSerializer(WxBuser.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| } | } | ||||
| @@ -7,7 +7,6 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.vo.WxCouponOrderCVo; | import com.iformall.domain.vo.WxCouponOrderCVo; | ||||
| import com.iformall.enums.EnumCouponVerifyType; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCouponOrderService; | import com.iformall.service.WxCouponOrderService; | ||||
| import com.iformall.service.WxMerchantBUserService; | import com.iformall.service.WxMerchantBUserService; | ||||
| @@ -146,9 +145,9 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | ||||
| } | } | ||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getById(getUserId()); | |||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getById(getUser().getId()); | |||||
| if (wxMerchantBUser == null) { | if (wxMerchantBUser == null) { | ||||
| logger.error("核销员ID不存在:" + getUserId()); | |||||
| logger.error("核销员ID不存在:" + getUser().getId()); | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | ||||
| } | } | ||||
| @@ -83,7 +83,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| wxMerchantTradeDaily.setTradeAmt(Double.parseDouble(wxMerchantTradeDaily.getTradeAmt())*100 +""); | wxMerchantTradeDaily.setTradeAmt(Double.parseDouble(wxMerchantTradeDaily.getTradeAmt())*100 +""); | ||||
| } | } | ||||
| WxMerchantBUser user = wxMerchantBUserService.getById(getUserId()); | |||||
| WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId()); | |||||
| if (user==null) | if (user==null) | ||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | ||||
| @@ -104,9 +104,9 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| wxMerchantTradeDaily.setbUserId(getUserId()); | |||||
| wxMerchantTradeDaily.setbUserId(getUser().getId()); | |||||
| logger.info("1------------------------------------" + wxMerchantTradeDaily.getbUserId()); | logger.info("1------------------------------------" + wxMerchantTradeDaily.getbUserId()); | ||||
| wxMerchantTradeDaily.setBUserId(getUserId()); | |||||
| wxMerchantTradeDaily.setBUserId(getUser().getId()); | |||||
| logger.info("2------------------------------------" + wxMerchantTradeDaily.getBUserId()); | logger.info("2------------------------------------" + wxMerchantTradeDaily.getBUserId()); | ||||
| wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily); | wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -127,7 +127,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| //根据userid查询merchantId | //根据userid查询merchantId | ||||
| WxMerchantBUser user = wxMerchantBUserService.getById(getUserId()); | |||||
| WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId()); | |||||
| if (user==null) | if (user==null) | ||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | ||||
| @@ -193,7 +193,7 @@ public class WxMicroPayController extends BaseController { | |||||
| record.setTenantId(getTenantId()); | record.setTenantId(getTenantId()); | ||||
| record.setId(payOrderId); | record.setId(payOrderId); | ||||
| record.setPayOrderNo(payOrderIdStr); | record.setPayOrderNo(payOrderIdStr); | ||||
| record.setBUserId(getUserId()); | |||||
| record.setBUserId(getUser().getId()); | |||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| try { | try { | ||||