|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
+import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.UserMapper;
|
|
|
@@ -91,6 +92,20 @@ public class CmsYhShopGoodsController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置店铺平台通用比例
|
|
|
+ */
|
|
|
+ @PutMapping("/set/shop/goods/general/rate")
|
|
|
+ public Result<Void> setShopGoodsGeneralRate(@RequestBody GoodsDonShopRateReq req) {
|
|
|
+ Integer rate = req.getRate();
|
|
|
+ if (rate == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的比例");
|
|
|
+ }
|
|
|
+ List<Long> goodsIds = req.getGoodsIds();
|
|
|
+ yhShopGoodsRateService.update(Wrappers.lambdaUpdate(YhShopGoodsRate.class).in(YhShopGoodsRate::getGoodsId, goodsIds).set(YhShopGoodsRate::getRate, rate));
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 店铺通用平台分销比例配置
|
|
|
*/
|