From d14979b36678ca8b72159cf403903d7a44c4d068 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 22 Jun 2022 15:17:34 +0800 Subject: [PATCH] //tt coupon --- .../controller/market/WxCouponController.java | 19 +++++++++---------- .../controller/WxCouponController.java | 4 ++-- .../impl/OrderSnapshotServiceImpl.java | 5 +++++ .../impl/WxCouponChannelServiceImpl.java | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index b6741f5f2..9269dc13f 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -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, "有活动正在上架,请先下架。"); } } diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java index d22a682e9..c2cbf80cc 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -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, "有活动正在上架,请先下架。"); } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java index 0dfb5f48d..7488878b7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java @@ -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 couponIdList = new ArrayList(); couponIdList.add(wxCoupon.getId()); Map> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, wxCoupon,true); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 0c67948d1..820bb311b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -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(),"未找到可用的数据");