lin 3 лет назад
Родитель
Сommit
8fecf0f24b
8 измененных файлов: 27 добавлений и 17 удалений
  1. +4
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +2
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java
  3. +1
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  4. +7
    -5
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  5. +3
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  6. +6
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxPressOrderController.java
  7. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  8. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java

+ 4
- 2
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java Просмотреть файл

@@ -407,7 +407,8 @@ public class WxCouponController extends BaseController {
@SystemControllerLog(description = "券投放-查询")
public ResultData findById(@RequestParam Long id) {
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
@@ -417,7 +418,8 @@ public class WxCouponController extends BaseController {
@SystemControllerLog(description = "券投放-查询")
public ResultData findParentCouponById(@RequestParam Long id) {
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


+ 2
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

@@ -383,7 +383,8 @@ public class WxCouponController extends BaseController {
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findById(@RequestParam Long id) {
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));
}




+ 1
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java Просмотреть файл

@@ -210,7 +210,7 @@ public class WxCouponOrderController extends BaseController {
return new ResultData(ErrorCode.COUPON_IS_EMPTY);
}
} else {
wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxMerchantBUser.getTenantId());
wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxMerchantBUser.getTenantId(),wxMerchantBUser);
if (wxCouponCVo == null) {
return new ResultData(ErrorCode.COUPON_IS_EMPTY);
}


+ 7
- 5
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

@@ -11,6 +11,7 @@ import java.util.stream.Collectors;

import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMiniappThemeValue;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumCouponType;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.utils.*;
@@ -393,7 +394,8 @@ public class WxCouponController extends BaseController {
//WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL);
WxCouponCVo wxCouponCVo = null;
try {
wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId());
TenantEntity tenantEntity = getTenantInfo();
wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,tenantEntity.getTenantId(),tenantEntity);
} catch (IllegalAccessException 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);
@@ -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){
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId);
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,couponTenantId);
if(cc == null){
return null;
}
WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId);
WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),couponTenantId,mallTenantEntity);
if(wxcv == null){
return null;
}
@@ -554,7 +556,7 @@ public class WxCouponController extends BaseController {
wxcv.setTtSpuId(cc.getTtSpuId());
return wxcv;
}else if(couponIdL > 0l){
WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId);
WxCouponCVo wxcv = couponService.getVoById(couponIdL,couponTenantId,mallTenantEntity);
return wxcv;
}
return null;


+ 3
- 2
mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java Просмотреть файл

@@ -119,7 +119,8 @@ public class WxCouponOrderController extends BaseController {
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) {
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
}
@@ -144,7 +145,7 @@ public class WxCouponOrderController extends BaseController {
return new ResultData(ErrorCode.COUPON_IS_EMPTY);
}
} else {
wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId());
wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId(),tenantEntity);
if (wxCouponCVo == null) {
return new ResultData(ErrorCode.COUPON_IS_EMPTY);
}


+ 6
- 2
mallinkCApi/src/main/java/com/iformall/controller/WxPressOrderController.java Просмотреть файл

@@ -6,6 +6,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxOrder;
import com.iformall.domain.po.WxOrderPress;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCouponCVo;
import com.iformall.enums.EnumOrderPressStatus;
import com.iformall.enums.EnumOrderStatus;
@@ -91,12 +92,15 @@ public class WxPressOrderController extends BaseController {
ValueOperations<String, WxOrder> operations = orderRedisTemplate.opsForValue();
// 缓存
boolean hasKey = orderRedisTemplate.hasKey(key);
TenantEntity tenantEntity = getTenantInfo();
if (hasKey) {
// 从缓存获取砍价订单信息
order = operations.get(key);
} else {
// 订单没有入缓存,需要从数据库中读取
order = wxOrderService.getById(orderId,getTenantInfo().getTenantId());
order = wxOrderService.getById(orderId,tenantEntity.getTenantId());
if (order != null) {
// 订单优化,进缓存
orderRedisTemplate.opsForValue().set(key, order, 3600, TimeUnit.SECONDS);
@@ -117,7 +121,7 @@ public class WxPressOrderController extends BaseController {
wxCouponCVo = cdOperations.get(cdKey);
} else {
// 券信息没有入缓存,需要从数据库中读取
wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId());
wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId(),tenantEntity);
if (wxCouponCVo != null) {
// 券详情优化,进缓存
couponCVoRedisTemplate.opsForValue().set(cdKey, wxCouponCVo, 3600, TimeUnit.SECONDS);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Просмотреть файл

@@ -81,7 +81,7 @@ public interface WxCouponService {
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);



+ 3
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -353,15 +353,15 @@ public class WxCouponServiceImpl implements WxCouponService {
}

@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){
return null;
}
List<Long> couponIdList = new ArrayList<Long>();
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());
if (merchantList != null) {


Загрузка…
Отмена
Сохранить