|
|
|
@@ -110,4 +110,37 @@ public class TtPoiPlanController extends BaseController { |
|
|
|
return ttCouponGoodsService.poiPlanUpdateStatus(getTenantInfo(),planId,status); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("商品达人分佣配置") |
|
|
|
@PostMapping("takeRate") |
|
|
|
@SystemControllerLog(description = "更新") |
|
|
|
public ResultData takeRate(@RequestBody Map<String, Object> param) { |
|
|
|
logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::takeRate"); |
|
|
|
Integer status = (Integer) param.get("status"); |
|
|
|
if(status == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态为空"); |
|
|
|
} |
|
|
|
if(status.intValue() != 1 || status.intValue() != 2){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不规范"); |
|
|
|
} |
|
|
|
Integer takeRate = (Integer) param.get("takeRate"); |
|
|
|
if(takeRate == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抽佣率为空"); |
|
|
|
} |
|
|
|
if(takeRate.intValue() < 100 || takeRate.intValue() > 2900){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抽佣率需在1%-29%之间"); |
|
|
|
} |
|
|
|
String douyinId = (String) param.get("douyinId"); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(douyinId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抖音号为空"); |
|
|
|
} |
|
|
|
String couponIdStr = (String) param.get("couponId"); |
|
|
|
if(StringUtils.isBlank(couponIdStr)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); |
|
|
|
} |
|
|
|
Long couponId = Long.parseLong(couponIdStr); |
|
|
|
|
|
|
|
return ttCouponGoodsService.poiTakeRate(getTenantInfo(),couponId,douyinId,takeRate,status); |
|
|
|
} |
|
|
|
|
|
|
|
} |