Browse Source

//tt coupon

release_toaliyun_real
xhxu 3 years ago
parent
commit
d14979b366
4 changed files with 17 additions and 13 deletions
  1. +9
    -10
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +2
    -2
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java
  3. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 9
- 10
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -7,11 +7,7 @@ import com.iformall.common.ErrorCode;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxCUserBasicInfo;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.WxCouponPassword;
import com.iformall.domain.po.WxPayAccount;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.TtCouponVo;
import com.iformall.domain.vo.WxCouponStatisVo;
@@ -53,7 +49,7 @@ public class WxCouponController extends BaseController {
@Autowired
private WxCouponPasswordService couponPasswordService;
@Autowired
private WxCouponChannelMapper wxCouponChannelMapper;
private WxCouponChannelService wxCouponChannelService;
@Autowired
private WxFlowService wxFlowService;
@Autowired
@@ -195,12 +191,15 @@ public class WxCouponController extends BaseController {
query.updateTenantInfo(wxCoupon);
query.setCouponId(wxCoupon.getId());
query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) {
if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) {
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。");
}
// query.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
// if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) {
// return new ResultData(ResultData.ERROR, "有活动正在预审核.");
// if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) {
// TtCouponChannelPoi ttCouponChannelPoi = wxCouponService.getCouponChannelPoi(getTenantInfo(),wxCoupon.getId());
// if(EnumSpuSyncStatus.sync_auditing.getCode().equals(ttCouponChannelPoi.getLastStatus())){
// return new ResultData(ResultData.ERROR, "有活动正在预审核.");
// }
// }
}
@@ -248,7 +247,7 @@ public class WxCouponController extends BaseController {
query.updateTenantInfo(wxCoupon);
query.setCouponId(wxCoupon.getId());
query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) {
if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) {
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。");
}
}


+ 2
- 2
mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java View File

@@ -49,7 +49,7 @@ public class WxCouponController extends BaseController {
@Autowired
private WxCouponPasswordService couponPasswordService;
@Autowired
private WxCouponChannelMapper wxCouponChannelMapper;
private WxCouponChannelService wxCouponChannelService;
@Autowired
private WxFlowService wxFlowService;
@Autowired
@@ -243,7 +243,7 @@ public class WxCouponController extends BaseController {
query.updateTenantInfo(wxCoupon);
query.setCouponId(wxCoupon.getId());
query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) {
if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) {
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。");
}
}


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java View File

@@ -80,6 +80,8 @@ public class OrderSnapshotServiceImpl implements OrderSnapshotService {
logger.error("同步订单快照异常---未找到商品数据");
return ;
}
WxCoupon attrsById = wxCouponMapper.getAttrsById(order.getProductId(), order.getTenantId());

OrderSnapshot snapshot = new OrderSnapshot();
final IdWorker idWorker = IdWorker.get();
Date now = new Date();
@@ -89,6 +91,9 @@ public class OrderSnapshotServiceImpl implements OrderSnapshotService {
snapshot.setOrderId(wxOrder.getId());
snapshot.initByCoupon(wxCoupon);

snapshot.setProductAttrs(attrsById.getProductAttrs());
snapshot.setSkuAttrs(attrsById.getSkuAttrs());

List<Long> couponIdList = new ArrayList<Long>();
couponIdList.add(wxCoupon.getId());
Map<Long, List<WxMerchantVo>> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, wxCoupon,true);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java View File

@@ -775,7 +775,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
@Override
public ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id) {
TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectByChannelId(tenantInfo.getTenantId(),id);
if(ttCouponChannelPoi != null && ttCouponChannelPoi.getStatus() != null && ttCouponChannelPoi.getStatus().intValue() > 0){
if(ttCouponChannelPoi != null && ttCouponChannelPoi.getLastStatus() != null && ttCouponChannelPoi.getLastStatus().intValue() > 0){
return new ResultData(ttCouponChannelPoi);
}
return new ResultData(ErrorCode.SYS_NULLPOINTER_ERROR.getCode(),"未找到可用的数据");


Loading…
Cancel
Save