Commit adf05479 by zhangchen

1.增加券校验

parent 7aa74767
...@@ -138,6 +138,7 @@ public class VoucherRuleController extends ...@@ -138,6 +138,7 @@ public class VoucherRuleController extends
ids = ids.substring(0, ids.length() - 1); ids = ids.substring(0, ids.length() - 1);
} }
VoucherRuleBean voucherRuleBean = voucherRuleService.get(id); VoucherRuleBean voucherRuleBean = voucherRuleService.get(id);
if (voucherRuleBean == null) { if (voucherRuleBean == null) {
reponse.setBody(false); reponse.setBody(false);
reponse.setMessage("新增发放用户失败"); reponse.setMessage("新增发放用户失败");
...@@ -282,6 +283,26 @@ public class VoucherRuleController extends ...@@ -282,6 +283,26 @@ public class VoucherRuleController extends
return response; return response;
} }
/**
* 获取券规则是否可以免费领取
*
*/
@ResponseBody
@RequestMapping(value = "/getVoucherRuleById", method = RequestMethod.POST)
public Response<Boolean> getVoucherRuleById(@RequestBody Request<Integer> request) {
Response<Boolean> response = new Response<Boolean>();
VoucherRuleBean voucherRuleBean = voucherRuleService.get(request.getBody());
if(voucherRuleBean.getCanFreeReceive() == 1){
response.setStatus(0);
response.setBody(true);
} else{
response.setStatus(0);
response.setBody(false);
}
return response;
}
@Override @Override
public VoucherRuleService getEntityService() { public VoucherRuleService getEntityService() {
return voucherRuleService; return voucherRuleService;
......
...@@ -147,6 +147,8 @@ public class VoucherRule { ...@@ -147,6 +147,8 @@ public class VoucherRule {
//每满多少减多少 列:如值为100,则 200<=订单金额<300可以使用两张 //每满多少减多少 列:如值为100,则 200<=订单金额<300可以使用两张
private BigDecimal fullCutAmount; private BigDecimal fullCutAmount;
private int canFreeReceive;//判断券是可以免费领取
@Id @Id
@GeneratedValue(strategy = IDENTITY) @GeneratedValue(strategy = IDENTITY)
...@@ -389,4 +391,13 @@ public class VoucherRule { ...@@ -389,4 +391,13 @@ public class VoucherRule {
this.fullCutAmount = fullCutAmount; this.fullCutAmount = fullCutAmount;
} }
public int getCanFreeReceive() {
return canFreeReceive;
}
public void setCanFreeReceive(int canFreeReceive) {
this.canFreeReceive = canFreeReceive;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment