Преглед изворни кода

//good

release_toaliyun_real
xhxu пре 3 година
родитељ
комит
a1243df87b
2 измењених фајлова са 49 додато и 51 уклоњено
  1. +8
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCouponChannelType.java
  2. +41
    -51
      mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java

+ 8
- 0
mallinkService/src/main/java/com/iformall/enums/EnumCouponChannelType.java Прегледај датотеку

@@ -5,6 +5,14 @@ package com.iformall.enums;
*/
public enum EnumCouponChannelType {

/**
* //投放到抖音渠道。
* //初次投放,只为展示审核,不让购买。
* //当券投放到其他渠道时,此渠道自动上架,才可购买。
* //其他所有渠道下架后,该渠道自动下架。
*/
COUPON_CHANNEL_ID_DOUYIN(0,"抖音"),

COUPON_CHANNEL_ID_LIST(1, "列表"),
COUPON_CHANNEL_ID_TIMED(2, "限时抢购"),
COUPON_CHANNEL_ID_CAMPAIN(3, "幻灯片"), // banner图, 宣传页,轮播图,走马灯


+ 41
- 51
mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java Прегледај датотеку

@@ -163,28 +163,6 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService {
}

//获取门店,确保所有门店匹配poi
// List<WxMerchantVo> couponMerchantList = wxCouponService.getCouponMerchantList(coupon, coupon.getId());
// if(couponMerchantList.size() > 0){
// List<WxMerchantVo> isAdminList = couponMerchantList.stream().filter(m -> EnumYesOrNo.YES.getCode().equals(m.getIsAdmin())).collect(Collectors.toList());
// if(isAdminList != null && isAdminList.size() == 1){
// couponMerchantList = isAdminList;
// }else if(isAdminList != null && isAdminList.size() > 1){
// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"数据异常,存在多个商管商户");
// }
// }
// List<Product.PoiStruct> poiList = new ArrayList();
// for (WxMerchantVo mvo:couponMerchantList){
// if(StringUtils.isNotBlank(mvo.getSupplierExtId())){
// Product.PoiStruct poiStruct = new Product.PoiStruct();
// poiStruct.setSupplierExtId(mvo.getSupplierExtId());
// poiList.add(poiStruct);
// }
// }
// if(poiList.isEmpty()){
// return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND.getCode(),"未找到poi门店");
// }


List<Long> merchantIds = wxCouponMerchantMapper.findMerchantIdListByProduct(coupon.getId(), coupon.getTenantId());
TtMerchantPoi poiQ = new TtMerchantPoi();
poiQ.updateTenantInfo(coupon);
@@ -209,39 +187,51 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService {
merchantQ.setSortColumns(BaseEntity.SortField.MerchantAdmin);
WxMerchant merchant = wxMerchantMapper.findIdNameList(merchantQ).get(0);

//查询是否有上架的
//投放到抖音渠道,获取详情地址,以做审核
WxCouponChannel wxCouponChannelQuery = new WxCouponChannel();
wxCouponChannelQuery.updateTenantInfo(coupon);
wxCouponChannelQuery.setCouponId(coupon.getId());
wxCouponChannelQuery.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode());
wxCouponChannelQuery.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
wxCouponChannelQuery.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN.getCode());
List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQuery);
if(wxCouponChannels.size() > 0){
return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED);
}
//预审核的作废掉 重新投放
wxCouponChannelQuery.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
WxCouponChannel updCouponChannel = new WxCouponChannel();
updCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_AFTER.getCode());
updCouponChannel.setUpdateDate(new Date());
wxCouponChannelMapper.update(updCouponChannel,new QueryWrapper<>(wxCouponChannelQuery));
//投放预审核
WxCouponChannel wxCouponChannel = new WxCouponChannel();
final IdWorker idWorker = IdWorker.get();
wxCouponChannel.setId(idWorker.nextId());
wxCouponChannel.updateTenantInfo(coupon);
wxCouponChannel.setShowBeginTime(new Date());
wxCouponChannel.setBeginTime(new Date());
wxCouponChannel.setEndTime(coupon.getValidEndDate());
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
wxCouponChannel.setCouponId(coupon.getId());
wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId());
wxCouponChannel.setType(coupon.getType());
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode());
wxCouponChannel.setBusiness(coupon.getBusiness());
wxCouponChannel.setSubBusiness(coupon.getSubBusiness());
wxCouponChannel.setTitle(coupon.getTitle());
wxCouponChannelMapper.insert(wxCouponChannel);
WxCouponChannel wxCouponChannel = null;
Date now = new Date();
if(wxCouponChannels == null || wxCouponChannels.isEmpty()){
wxCouponChannel = new WxCouponChannel();
final IdWorker idWorker = IdWorker.get();
wxCouponChannel.setId(idWorker.nextId());
wxCouponChannel.updateTenantInfo(coupon);
wxCouponChannel.setShowBeginTime(now);
wxCouponChannel.setBeginTime(now);
wxCouponChannel.setEndTime(coupon.getValidEndDate());
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
wxCouponChannel.setCouponId(coupon.getId());
wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId());
wxCouponChannel.setType(coupon.getType());
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN.getCode());
wxCouponChannel.setBusiness(coupon.getBusiness());
wxCouponChannel.setSubBusiness(coupon.getSubBusiness());
wxCouponChannel.setTitle(coupon.getTitle());
wxCouponChannelMapper.insert(wxCouponChannel);

}else if(wxCouponChannels.size() == 1){
wxCouponChannel = wxCouponChannels.get(0);
wxCouponChannel.setShowBeginTime(now);
wxCouponChannel.setBeginTime(now);
wxCouponChannel.setEndTime(coupon.getValidEndDate());
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
wxCouponChannel.setCouponId(coupon.getId());
wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId());
wxCouponChannel.setType(coupon.getType());
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN.getCode());
wxCouponChannel.setBusiness(coupon.getBusiness());
wxCouponChannel.setSubBusiness(coupon.getSubBusiness());
wxCouponChannel.setTitle(coupon.getTitle());
wxCouponChannel.setUpdateDate(now);
wxCouponChannelMapper.updateById(wxCouponChannel);

}else{
return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"此券状态异常,请重新创建");
}

//提交审核
try {


Loading…
Откажи
Сачувај