Commit adf05479 by zhangchen

1.增加券校验

parent 7aa74767
......@@ -138,6 +138,7 @@ public class VoucherRuleController extends
ids = ids.substring(0, ids.length() - 1);
}
VoucherRuleBean voucherRuleBean = voucherRuleService.get(id);
if (voucherRuleBean == null) {
reponse.setBody(false);
reponse.setMessage("新增发放用户失败");
......@@ -282,6 +283,26 @@ public class VoucherRuleController extends
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
public VoucherRuleService getEntityService() {
return voucherRuleService;
......
......@@ -147,6 +147,8 @@ public class VoucherRule {
//每满多少减多少 列:如值为100,则 200<=订单金额<300可以使用两张
private BigDecimal fullCutAmount;
private int canFreeReceive;//判断券是可以免费领取
@Id
@GeneratedValue(strategy = IDENTITY)
......@@ -389,4 +391,13 @@ public class VoucherRule {
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