| @@ -407,7 +407,8 @@ public class WxCouponController extends BaseController { | |||||
| @SystemControllerLog(description = "券投放-查询") | @SystemControllerLog(description = "券投放-查询") | ||||
| public ResultData findById(@RequestParam Long id) { | public ResultData findById(@RequestParam Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | ||||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getTenantId())); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| return new ResultData(wxCouponService.getVoById(id,tenantEntity.getTenantId(),tenantEntity)); | |||||
| } | } | ||||
| @TenantIgnore | @TenantIgnore | ||||
| @@ -417,7 +418,8 @@ public class WxCouponController extends BaseController { | |||||
| @SystemControllerLog(description = "券投放-查询") | @SystemControllerLog(description = "券投放-查询") | ||||
| public ResultData findParentCouponById(@RequestParam Long id) { | public ResultData findParentCouponById(@RequestParam Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | ||||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getParentTenantId())); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getParentTenantId(),tenantEntity)); | |||||
| } | } | ||||
| @TenantIgnore | @TenantIgnore | ||||
| @@ -383,7 +383,8 @@ public class WxCouponController extends BaseController { | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(@RequestParam Long id) { | public ResultData findById(@RequestParam Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | ||||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getTenantId())); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| return new ResultData(wxCouponService.getVoById(id,tenantEntity.getTenantId(),tenantEntity)); | |||||
| } | } | ||||
| @@ -210,7 +210,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| } else { | } else { | ||||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxMerchantBUser.getTenantId()); | |||||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxMerchantBUser.getTenantId(),wxMerchantBUser); | |||||
| if (wxCouponCVo == null) { | if (wxCouponCVo == null) { | ||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| @@ -11,6 +11,7 @@ import java.util.stream.Collectors; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxMiniappThemeValue; | import com.iformall.domain.po.WxMiniappThemeValue; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumCouponType; | import com.iformall.enums.EnumCouponType; | ||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.utils.*; | import com.iformall.utils.*; | ||||
| @@ -393,7 +394,8 @@ public class WxCouponController extends BaseController { | |||||
| //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | ||||
| WxCouponCVo wxCouponCVo = null; | WxCouponCVo wxCouponCVo = null; | ||||
| try { | try { | ||||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId()); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,tenantEntity.getTenantId(),tenantEntity); | |||||
| } catch (IllegalAccessException e) { | } catch (IllegalAccessException e) { | ||||
| logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | ||||
| @@ -529,13 +531,13 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String couponTenantId,TenantEntity mallTenantEntity) throws IllegalAccessException, InvocationTargetException { | |||||
| if(couponChannelIdL > 0l){ | if(couponChannelIdL > 0l){ | ||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,couponTenantId); | |||||
| if(cc == null){ | if(cc == null){ | ||||
| return null; | return null; | ||||
| } | } | ||||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId); | |||||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),couponTenantId,mallTenantEntity); | |||||
| if(wxcv == null){ | if(wxcv == null){ | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -554,7 +556,7 @@ public class WxCouponController extends BaseController { | |||||
| wxcv.setTtSpuId(cc.getTtSpuId()); | wxcv.setTtSpuId(cc.getTtSpuId()); | ||||
| return wxcv; | return wxcv; | ||||
| }else if(couponIdL > 0l){ | }else if(couponIdL > 0l){ | ||||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); | |||||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,couponTenantId,mallTenantEntity); | |||||
| return wxcv; | return wxcv; | ||||
| } | } | ||||
| return null; | return null; | ||||
| @@ -119,7 +119,8 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,getTenantInfo()); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,tenantEntity); | |||||
| if (wxCouponOrderCVo == null) { | if (wxCouponOrderCVo == null) { | ||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | ||||
| } | } | ||||
| @@ -144,7 +145,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| } else { | } else { | ||||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId()); | |||||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId(),tenantEntity); | |||||
| if (wxCouponCVo == null) { | if (wxCouponCVo == null) { | ||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxOrderPress; | import com.iformall.domain.po.WxOrderPress; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.enums.EnumOrderPressStatus; | import com.iformall.enums.EnumOrderPressStatus; | ||||
| import com.iformall.enums.EnumOrderStatus; | import com.iformall.enums.EnumOrderStatus; | ||||
| @@ -91,12 +92,15 @@ public class WxPressOrderController extends BaseController { | |||||
| ValueOperations<String, WxOrder> operations = orderRedisTemplate.opsForValue(); | ValueOperations<String, WxOrder> operations = orderRedisTemplate.opsForValue(); | ||||
| // 缓存 | // 缓存 | ||||
| boolean hasKey = orderRedisTemplate.hasKey(key); | boolean hasKey = orderRedisTemplate.hasKey(key); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| if (hasKey) { | if (hasKey) { | ||||
| // 从缓存获取砍价订单信息 | // 从缓存获取砍价订单信息 | ||||
| order = operations.get(key); | order = operations.get(key); | ||||
| } else { | } else { | ||||
| // 订单没有入缓存,需要从数据库中读取 | // 订单没有入缓存,需要从数据库中读取 | ||||
| order = wxOrderService.getById(orderId,getTenantInfo().getTenantId()); | |||||
| order = wxOrderService.getById(orderId,tenantEntity.getTenantId()); | |||||
| if (order != null) { | if (order != null) { | ||||
| // 订单优化,进缓存 | // 订单优化,进缓存 | ||||
| orderRedisTemplate.opsForValue().set(key, order, 3600, TimeUnit.SECONDS); | orderRedisTemplate.opsForValue().set(key, order, 3600, TimeUnit.SECONDS); | ||||
| @@ -117,7 +121,7 @@ public class WxPressOrderController extends BaseController { | |||||
| wxCouponCVo = cdOperations.get(cdKey); | wxCouponCVo = cdOperations.get(cdKey); | ||||
| } else { | } else { | ||||
| // 券信息没有入缓存,需要从数据库中读取 | // 券信息没有入缓存,需要从数据库中读取 | ||||
| wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId()); | |||||
| wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId(),tenantEntity); | |||||
| if (wxCouponCVo != null) { | if (wxCouponCVo != null) { | ||||
| // 券详情优化,进缓存 | // 券详情优化,进缓存 | ||||
| couponCVoRedisTemplate.opsForValue().set(cdKey, wxCouponCVo, 3600, TimeUnit.SECONDS); | couponCVoRedisTemplate.opsForValue().set(cdKey, wxCouponCVo, 3600, TimeUnit.SECONDS); | ||||
| @@ -81,7 +81,7 @@ public interface WxCouponService { | |||||
| WxCoupon getHtmlById(Long id,String tenantId); | WxCoupon getHtmlById(Long id,String tenantId); | ||||
| WxCouponCVo getVoById(Long id,String tenantId); | |||||
| WxCouponCVo getVoById(Long id,String couponTenantId,TenantEntity mallTenantEntity); | |||||
| WxCouponCVo getVoStatusById(Long id,String tenantId); | WxCouponCVo getVoStatusById(Long id,String tenantId); | ||||
| @@ -353,15 +353,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxCouponCVo getVoById(Long id,String tenantId) { | |||||
| WxCouponCVo wxCouponCVo = wxCouponMapper.findVoDetail(id,tenantId); | |||||
| public WxCouponCVo getVoById(Long id,String couponTenantId,TenantEntity mallTenantEntity) { | |||||
| WxCouponCVo wxCouponCVo = wxCouponMapper.findVoDetail(id,couponTenantId); | |||||
| if(wxCouponCVo == null){ | if(wxCouponCVo == null){ | ||||
| return null; | return null; | ||||
| } | } | ||||
| List<Long> couponIdList = new ArrayList<Long>(); | List<Long> couponIdList = new ArrayList<Long>(); | ||||
| couponIdList.add(wxCouponCVo.getId()); | couponIdList.add(wxCouponCVo.getId()); | ||||
| Map<Long, List<WxMerchantVo>> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, wxCouponCVo,true); | |||||
| Map<Long, List<WxMerchantVo>> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, mallTenantEntity,true); | |||||
| List<WxMerchantVo> merchantList = couponMerchantVoMap.get(wxCouponCVo.getId()); | List<WxMerchantVo> merchantList = couponMerchantVoMap.get(wxCouponCVo.getId()); | ||||
| if (merchantList != null) { | if (merchantList != null) { | ||||