| @@ -7,11 +7,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | 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.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.TtCouponVo; | import com.iformall.domain.vo.TtCouponVo; | ||||
| import com.iformall.domain.vo.WxCouponStatisVo; | import com.iformall.domain.vo.WxCouponStatisVo; | ||||
| @@ -53,7 +49,7 @@ public class WxCouponController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponPasswordService couponPasswordService; | private WxCouponPasswordService couponPasswordService; | ||||
| @Autowired | @Autowired | ||||
| private WxCouponChannelMapper wxCouponChannelMapper; | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| @Autowired | @Autowired | ||||
| private WxFlowService wxFlowService; | private WxFlowService wxFlowService; | ||||
| @Autowired | @Autowired | ||||
| @@ -195,12 +191,15 @@ public class WxCouponController extends BaseController { | |||||
| query.updateTenantInfo(wxCoupon); | query.updateTenantInfo(wxCoupon); | ||||
| query.setCouponId(wxCoupon.getId()); | query.setCouponId(wxCoupon.getId()); | ||||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) { | |||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | ||||
| } | } | ||||
| // query.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode()); | // 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.updateTenantInfo(wxCoupon); | ||||
| query.setCouponId(wxCoupon.getId()); | query.setCouponId(wxCoupon.getId()); | ||||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) { | |||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | ||||
| } | } | ||||
| } | } | ||||
| @@ -49,7 +49,7 @@ public class WxCouponController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponPasswordService couponPasswordService; | private WxCouponPasswordService couponPasswordService; | ||||
| @Autowired | @Autowired | ||||
| private WxCouponChannelMapper wxCouponChannelMapper; | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| @Autowired | @Autowired | ||||
| private WxFlowService wxFlowService; | private WxFlowService wxFlowService; | ||||
| @Autowired | @Autowired | ||||
| @@ -243,7 +243,7 @@ public class WxCouponController extends BaseController { | |||||
| query.updateTenantInfo(wxCoupon); | query.updateTenantInfo(wxCoupon); | ||||
| query.setCouponId(wxCoupon.getId()); | query.setCouponId(wxCoupon.getId()); | ||||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))) { | |||||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | ||||
| } | } | ||||
| } | } | ||||
| @@ -80,6 +80,8 @@ public class OrderSnapshotServiceImpl implements OrderSnapshotService { | |||||
| logger.error("同步订单快照异常---未找到商品数据"); | logger.error("同步订单快照异常---未找到商品数据"); | ||||
| return ; | return ; | ||||
| } | } | ||||
| WxCoupon attrsById = wxCouponMapper.getAttrsById(order.getProductId(), order.getTenantId()); | |||||
| OrderSnapshot snapshot = new OrderSnapshot(); | OrderSnapshot snapshot = new OrderSnapshot(); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| Date now = new Date(); | Date now = new Date(); | ||||
| @@ -89,6 +91,9 @@ public class OrderSnapshotServiceImpl implements OrderSnapshotService { | |||||
| snapshot.setOrderId(wxOrder.getId()); | snapshot.setOrderId(wxOrder.getId()); | ||||
| snapshot.initByCoupon(wxCoupon); | snapshot.initByCoupon(wxCoupon); | ||||
| snapshot.setProductAttrs(attrsById.getProductAttrs()); | |||||
| snapshot.setSkuAttrs(attrsById.getSkuAttrs()); | |||||
| List<Long> couponIdList = new ArrayList<Long>(); | List<Long> couponIdList = new ArrayList<Long>(); | ||||
| couponIdList.add(wxCoupon.getId()); | couponIdList.add(wxCoupon.getId()); | ||||
| Map<Long, List<WxMerchantVo>> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, wxCoupon,true); | Map<Long, List<WxMerchantVo>> couponMerchantVoMap = wxMerchantService.findCouponMerchantVoList(couponIdList, wxCoupon,true); | ||||
| @@ -775,7 +775,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| @Override | @Override | ||||
| public ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id) { | public ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id) { | ||||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectByChannelId(tenantInfo.getTenantId(),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(ttCouponChannelPoi); | ||||
| } | } | ||||
| return new ResultData(ErrorCode.SYS_NULLPOINTER_ERROR.getCode(),"未找到可用的数据"); | return new ResultData(ErrorCode.SYS_NULLPOINTER_ERROR.getCode(),"未找到可用的数据"); | ||||