Browse Source

//..refund

release_toaliyun_real
xhxu 3 years ago
parent
commit
c4eaa49a5d
6 changed files with 76 additions and 11 deletions
  1. +40
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/basic/TtGoodsCategoryController.java
  2. +6
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumCouponChannelType.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/service/TtGoodsCategoryService.java
  4. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/TtGoodsCategoryServiceImpl.java
  5. +23
    -7
      mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java
  6. +1
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java

+ 40
- 3
mallinkAdmin/src/main/java/com/iformall/controller/basic/TtGoodsCategoryController.java View File

@@ -18,6 +18,8 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;


import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;


import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -57,17 +59,52 @@ public class TtGoodsCategoryController extends DouyinBaseController {
} }
} }


/**
* 分级获取抖音类目 getParent
* @param categoryId
* @return
*/
@ApiOperation("查询类目")
@GetMapping("getParent")
@ApiImplicitParams({})
@SystemControllerLog(description = "列表")
public ResultData getParent(Integer categoryId) {
logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::getParent");
if(categoryId == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
TtGoodsCategory goodsCategory = ttGoodsCategoryService.getGoodsCategory(categoryId);
if(goodsCategory == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"未找到当前目录");
}
if(goodsCategory.getParentId() == null || goodsCategory.getParentId() == 0){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"需要传入第三级类目");
}
TtGoodsCategory parentGoodsCategory = ttGoodsCategoryService.getGoodsCategory(goodsCategory.getParentId());
if(parentGoodsCategory == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"未找到父级目录");
}
if(goodsCategory.getParentId() == null || goodsCategory.getParentId() == 0){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"需要传入第三级类目");
}
Map<String,Integer> map = new HashMap<>();
map.put("firstCategoryId",parentGoodsCategory.getParentId());
map.put("secondCategoryId",parentGoodsCategory.getId());
map.put("thirdCategoryId",goodsCategory.getId());
return new ResultData(map);
}

/** /**
* 分级获取抖音类目 onlin * 分级获取抖音类目 onlin
* @param categoryId * @param categoryId
* @return * @return
*/ */
@ApiOperation("查询类目") @ApiOperation("查询类目")
@GetMapping("getOnlin")
@GetMapping("getOnline")
@ApiImplicitParams({}) @ApiImplicitParams({})
@SystemControllerLog(description = "列表") @SystemControllerLog(description = "列表")
public ResultData categoryGet(Integer categoryId) {
logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::categoryGet");
public ResultData getOnline(Integer categoryId) {
logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::getOnline");
if(categoryId == null){ if(categoryId == null){
categoryId = 0; categoryId = 0;
} }


+ 6
- 1
mallinkService/src/main/java/com/iformall/enums/EnumCouponChannelType.java View File

@@ -25,6 +25,7 @@ public enum EnumCouponChannelType {
COUPON_CHANNEL_ID_LIST(1, "列表"), COUPON_CHANNEL_ID_LIST(1, "列表"),
COUPON_CHANNEL_ID_TIMED(2, "限时抢购"), COUPON_CHANNEL_ID_TIMED(2, "限时抢购"),
COUPON_CHANNEL_ID_CAMPAIN(3, "幻灯片"), // banner图, 宣传页,轮播图,走马灯 COUPON_CHANNEL_ID_CAMPAIN(3, "幻灯片"), // banner图, 宣传页,轮播图,走马灯

COUPON_CHANNEL_ID_GAME(4, "游戏"), COUPON_CHANNEL_ID_GAME(4, "游戏"),
COUPON_CHANNEL_ID_CARD(5, "卡频道"), COUPON_CHANNEL_ID_CARD(5, "卡频道"),
COUPON_CHANNEL_ID_PRESS(6, "砍价频道"), COUPON_CHANNEL_ID_PRESS(6, "砍价频道"),
@@ -34,8 +35,10 @@ public enum EnumCouponChannelType {
COUPON_CHANNEL_ID_H5(100, "DSP的H5页面"), COUPON_CHANNEL_ID_H5(100, "DSP的H5页面"),


COUPON_CHANNEL_ID_DOUYIN_LIST(101, "抖音列表"), COUPON_CHANNEL_ID_DOUYIN_LIST(101, "抖音列表"),
COUPON_CHANNEL_ID_DOUYIN_CAMPAIN(103, "抖音轮播图"),
COUPON_CHANNEL_ID_WXLIVE_LIST(102, "微信直播列表") COUPON_CHANNEL_ID_WXLIVE_LIST(102, "微信直播列表")

; ;


public static EnumCouponChannelType getEnum(Integer code) { public static EnumCouponChannelType getEnum(Integer code) {
@@ -78,6 +81,7 @@ public enum EnumCouponChannelType {
public static List<Integer> getDouYinType(){ public static List<Integer> getDouYinType(){
List<Integer> typeList = new ArrayList<>(); List<Integer> typeList = new ArrayList<>();
typeList.add(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); typeList.add(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode());
typeList.add(COUPON_CHANNEL_ID_DOUYIN_CAMPAIN.getCode());
return typeList; return typeList;
} }


@@ -143,7 +147,8 @@ public enum EnumCouponChannelType {
//微信 积分商城 //微信 积分商城
codes.add(EnumCouponType.COUPON_CREDIT.getCode()); codes.add(EnumCouponType.COUPON_CREDIT.getCode());
codes.add(EnumCouponType.COUPON_CREDIT_PARK.getCode()); codes.add(EnumCouponType.COUPON_CREDIT_PARK.getCode());
}else if(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode().equals(code)){
}else if(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode().equals(code)
|| COUPON_CHANNEL_ID_DOUYIN_CAMPAIN.getCode().equals(code)){
//抖音 列表 //抖音 列表
codes.add(EnumCouponType.COUPON_DOUYIN.getCode()); codes.add(EnumCouponType.COUPON_DOUYIN.getCode());
codes.add(EnumCouponType.COUPON_DOUYIN_PLAT.getCode()); codes.add(EnumCouponType.COUPON_DOUYIN_PLAT.getCode());


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/TtGoodsCategoryService.java View File

@@ -54,4 +54,5 @@ public interface TtGoodsCategoryService {


int getTtServiceFee(Integer categoryId); int getTtServiceFee(Integer categoryId);


TtGoodsCategory getGoodsCategory(Integer categoryId);
} }

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

@@ -664,6 +664,11 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService {
return 0; return 0;
} }


@Override
public TtGoodsCategory getGoodsCategory(Integer categoryId) {
return ttGoodsCategoryMapper.selectById(categoryId);
}

/** /**
* 循环同步类目 * 循环同步类目
* @param ttWebService * @param ttWebService


+ 23
- 7
mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java View File

@@ -141,10 +141,10 @@ public class WxCampaignServiceImpl implements WxCampaignService {
} else { } else {
wxCampaignMapper.updateById(wxCampaign); wxCampaignMapper.updateById(wxCampaign);
} }
if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){
// if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){
//type 为固定格式才会有券的信息 才会有投放的问题 //type 为固定格式才会有券的信息 才会有投放的问题
couponInject(wxCampaign); couponInject(wxCampaign);
}
// }
return new ResultData(Result.SUCCESS,"操作成功"); return new ResultData(Result.SUCCESS,"操作成功");
} }


@@ -189,10 +189,10 @@ public class WxCampaignServiceImpl implements WxCampaignService {
WxCampaign campaign = wxCampaignMapper.selectById(wxCampaign.getId()); WxCampaign campaign = wxCampaignMapper.selectById(wxCampaign.getId());
this.updateOtherStatus(campaign.getProduceId(),campaign.getStatus(),campaign.getProduceType()); this.updateOtherStatus(campaign.getProduceId(),campaign.getStatus(),campaign.getProduceType());
} }
if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){
// if(EnumAppPlat.WX.getCode().equals(wxCampaign.getPlat())){
//type 为固定格式才会有券的信息 才会有投放的问题 //type 为固定格式才会有券的信息 才会有投放的问题
couponInject(wxCampaign); couponInject(wxCampaign);
}
// }
return new ResultData(Result.SUCCESS, "操作成功"); return new ResultData(Result.SUCCESS, "操作成功");
} }


@@ -234,10 +234,14 @@ public class WxCampaignServiceImpl implements WxCampaignService {
} }


public void delBatch(WxCampaign record) { public void delBatch(WxCampaign record) {
Integer targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode();
if(EnumAppPlat.TOUTIAO.getCode().equals(record.getPlat())){
targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_CAMPAIN.getCode();
}
// couponChannel 下架 // couponChannel 下架
WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); WxCouponChannel wxCouponChannelQ = new WxCouponChannel();
wxCouponChannelQ.updateTenantInfo(record); wxCouponChannelQ.updateTenantInfo(record);
wxCouponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode());
wxCouponChannelQ.setTargetAd(targetAd);
wxCouponChannelQ.setSubTargetId(record.getId()); wxCouponChannelQ.setSubTargetId(record.getId());
wxCouponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQ); List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQ);
@@ -251,10 +255,14 @@ public class WxCampaignServiceImpl implements WxCampaignService {
} }


public void addOrUpdateBatch(List<String> ids, WxCampaign record) { public void addOrUpdateBatch(List<String> ids, WxCampaign record) {
Integer targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode();
if(EnumAppPlat.TOUTIAO.getCode().equals(record.getPlat())){
targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_CAMPAIN.getCode();
}
// 获取已上架的CouponChannel // 获取已上架的CouponChannel
WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); WxCouponChannel wxCouponChannelQ = new WxCouponChannel();
wxCouponChannelQ.updateTenantInfo(record); wxCouponChannelQ.updateTenantInfo(record);
wxCouponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode());
wxCouponChannelQ.setTargetAd(targetAd);
wxCouponChannelQ.setSubTargetId(record.getId()); wxCouponChannelQ.setSubTargetId(record.getId());
wxCouponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQ); List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQ);
@@ -323,6 +331,11 @@ public class WxCampaignServiceImpl implements WxCampaignService {
} }
} }


Integer targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode();
if(EnumAppPlat.TOUTIAO.getCode().equals(record.getPlat())){
targetAd = EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_CAMPAIN.getCode();
}

// 已有的couponChannel, 更新 // 已有的couponChannel, 更新
WxCouponChannel wxCouponChannel = wxCouponChannelsMap.get(couponId); WxCouponChannel wxCouponChannel = wxCouponChannelsMap.get(couponId);
if (wxCouponChannel != null) { if (wxCouponChannel != null) {
@@ -354,16 +367,19 @@ public class WxCampaignServiceImpl implements WxCampaignService {
wxCouponChannel.setCouponId(couponId); wxCouponChannel.setCouponId(couponId);
wxCouponChannel.setMakeMerchantId(wxCoupon.getMakeMerchantId()); wxCouponChannel.setMakeMerchantId(wxCoupon.getMakeMerchantId());
wxCouponChannel.setType(wxCoupon.getType()); wxCouponChannel.setType(wxCoupon.getType());
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode());
wxCouponChannel.setTargetAd(targetAd);
wxCouponChannel.setBusiness(wxCoupon.getBusiness()); wxCouponChannel.setBusiness(wxCoupon.getBusiness());
wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness());
wxCouponChannel.setTitle(wxCoupon.getTitle()); wxCouponChannel.setTitle(wxCoupon.getTitle());
wxCouponChannel.setTtSpuId(wxCoupon.getGoodsId());
wxCouponChannel.setSubTargetId(record.getId()); wxCouponChannel.setSubTargetId(record.getId());
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
wxCouponChannel.setId(idWorker.nextId()); wxCouponChannel.setId(idWorker.nextId());
wxCouponChannelMapper.insert(wxCouponChannel); wxCouponChannelMapper.insert(wxCouponChannel);


wxCouponChannelService.updateQrCode(wxCouponChannel,wxCouponChannel.getId(),wxCouponChannel.getType()); wxCouponChannelService.updateQrCode(wxCouponChannel,wxCouponChannel.getId(),wxCouponChannel.getType());

wxCouponChannelService.spuStatusSyncByCoupon(wxCouponChannel,wxCouponChannel.getCouponId());
} }
} }




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

@@ -276,6 +276,7 @@ public class WxCouponServiceImpl implements WxCouponService {
//默认查微信平台 //默认查微信平台
wxCoupon.setPlat(EnumAppPlat.WX.getCode()); wxCoupon.setPlat(EnumAppPlat.WX.getCode());
} }

List<Integer> typeCode = EnumCouponType.getTypeCode(wxCoupon.getPlat()); List<Integer> typeCode = EnumCouponType.getTypeCode(wxCoupon.getPlat());
if(types == null || types.isEmpty()){ if(types == null || types.isEmpty()){
types = typeCode; types = typeCode;


Loading…
Cancel
Save