|
@@ -1,5 +1,6 @@
|
|
|
package com.xynet.marketing.controller.inner;
|
|
|
|
|
|
+import com.xynet.marketing.service.MercService;
|
|
|
import com.xynet.marketing.service.factory.coupon.merc.MercCouponFactory;
|
|
|
import com.xynet.marketing.utils.FactoryUtils;
|
|
|
import com.xynet.marketing.utils.R;
|
|
@@ -23,6 +24,7 @@ import java.util.Map;
|
|
|
@CrossOrigin(origins = "*")
|
|
|
public class InnerCouponController {
|
|
|
|
|
|
+ private MercService mercService;
|
|
|
|
|
|
/**
|
|
|
* 会员注册时-发送优惠券给会员
|
|
@@ -34,6 +36,8 @@ public class InnerCouponController {
|
|
|
@PostMapping("registerSend")
|
|
|
public R registerSend(@RequestBody JHashMap<String, Object> param, @RequestHeader Map<String, String> headers) {
|
|
|
MercCouponFactory mercCouponFactory = FactoryUtils.getService(MercCouponFactory.class, "merc_coupon_base");
|
|
|
+ Integer mercId = mercService.thirdMercIdToMercId(headers.get("providerId"), param.getString("thirdMercId"));
|
|
|
+ param.put("mercId", mercId);
|
|
|
mercCouponFactory.registerSend(param);
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -48,6 +52,8 @@ public class InnerCouponController {
|
|
|
@PostMapping("orderSend")
|
|
|
public R orderSend(@RequestBody JHashMap<String, Object> param, @RequestHeader Map<String, String> headers) {
|
|
|
MercCouponFactory mercCouponFactory = FactoryUtils.getService(MercCouponFactory.class, "merc_coupon_base");
|
|
|
+ Integer mercId = mercService.thirdMercIdToMercId(headers.get("providerId"), param.getString("thirdMercId"));
|
|
|
+ param.put("mercId", mercId);
|
|
|
mercCouponFactory.orderSend(param);
|
|
|
return R.ok();
|
|
|
}
|