|
@@ -4,11 +4,9 @@ package com.ym.mec.web.controller;
|
|
|
import com.ym.mec.biz.service.SysCouponIssueRecordService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import com.ym.mec.common.page.WrapperUtil;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.Map;
|
|
@@ -38,19 +36,54 @@ public class SysCouponIssueRecordController extends BaseController {
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 检查撤销的优惠券
|
|
|
+ *
|
|
|
+ * @param param issueId发放记录id
|
|
|
+ */
|
|
|
@ApiOperation("检查撤销的优惠券")
|
|
|
@PostMapping(value = "/checkRevoke")
|
|
|
- public HttpResponseResult checkRevoke(Integer id) {
|
|
|
- return succeed(couponIssueRecordService.checkRevoke(id));
|
|
|
+ public HttpResponseResult checkRevoke(@RequestBody Map<String, Object> param) {
|
|
|
+ Integer issueId = WrapperUtil.toInt(param, "issueId", "传入参数错误!");
|
|
|
+ return succeed(couponIssueRecordService.checkRevoke(issueId));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 撤销发放优惠券
|
|
|
+ *
|
|
|
+ * @param param issueId发放记录id
|
|
|
+ */
|
|
|
@ApiOperation("撤销发放优惠券")
|
|
|
@PostMapping(value = "/revokeCoupon")
|
|
|
- public HttpResponseResult revokeCoupon(Integer id) {
|
|
|
- couponIssueRecordService.revokeCoupon(id);
|
|
|
+ public HttpResponseResult revokeCoupon(@RequestBody Map<String, Object> param) {
|
|
|
+ Integer issueId = WrapperUtil.toInt(param, "issueId", "传入参数错误!");
|
|
|
+ couponIssueRecordService.revokeCoupon(issueId);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 手动领取优惠券
|
|
|
+ *
|
|
|
+ * @param param userId 领取者id
|
|
|
+ * @param param couponId 优惠券id
|
|
|
+ */
|
|
|
+ @ApiOperation("手动领取优惠券")
|
|
|
+ @PostMapping(value = "/manualIssueCoupon")
|
|
|
+ public HttpResponseResult manualIssueCoupon(@RequestBody Map<String, Object> param) {
|
|
|
+ Integer userId = WrapperUtil.toInt(param, "userId", "传入参数错误!");
|
|
|
+ Integer couponId = WrapperUtil.toInt(param, "couponId", "传入参数错误!");
|
|
|
+ couponIssueRecordService.manualIssueCoupon(userId, couponId);
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询优惠券发放名单
|
|
|
+ *
|
|
|
+ * @param param issueId 发放记录id
|
|
|
+ * @param param organId 分部id
|
|
|
+ * @param param subjectId 声部id
|
|
|
+ * @param param usageStatus 状态
|
|
|
+ */
|
|
|
@ApiOperation("查询优惠券发放名单")
|
|
|
@PostMapping(value = "/queryIssueDetail")
|
|
|
public HttpResponseResult queryIssueDetail(@RequestBody Map<String, Object> param) {
|
|
@@ -63,5 +96,11 @@ public class SysCouponIssueRecordController extends BaseController {
|
|
|
return succeed(couponIssueRecordService.queryIssueRecord(param));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("查询优惠券发放记录")
|
|
|
+ @GetMapping(value = "/queryCanBeGet")
|
|
|
+ public HttpResponseResult queryCanBeGetCoupon(Integer userId) {
|
|
|
+ return succeed(couponIssueRecordService.queryCanBeGetCoupon(userId));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|