记得上下班打卡 | git大法好,push需谨慎

Commit 83b7935a authored by 胡佳晨's avatar 胡佳晨

修改使用券逻辑

parent c947b5af
......@@ -145,21 +145,21 @@ public class CandyCouponController {
return ResponseDto.success(candyCouponService.myAdvanceCoupon(performanceId));
}
//判断券是否可用
@GetMapping("state")
@ApiOperation("券是否可用")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "uCouponId", value = "券唯一表示id", required = true),
})
public ResponseDto<HashMap<String, Integer>> stateCoupon(@RequestParam("uCouponId") @NotNull @NotBlank String uCouponId) {
Integer result = candyCouponService.stateCoupon(uCouponId);
if (result == null) {
return ResponseDto.failure();
}
HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
hashMap.put("state", result);
return ResponseDto.success(hashMap);
}
// //判断券是否可用
// @GetMapping("state")
// @ApiOperation("券是否可用")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", dataType = "String", name = "uCouponId", value = "券唯一表示id", required = true),
// })
// public ResponseDto<HashMap<String, Integer>> stateCoupon(@RequestParam("uCouponId") @NotNull @NotBlank String uCouponId) {
// Integer result = candyCouponService.stateCoupon(uCouponId);
// if (result == null) {
// return ResponseDto.failure();
// }
// HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
// hashMap.put("state", result);
// return ResponseDto.success(hashMap);
// }
//判断券是否可用并使用
@PostMapping("use")
......
......@@ -322,6 +322,10 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
if(dto.getBusiType().equals(0)){
isTarget = true;
}
if (!isTarget) {
vo.setCouType(-1);
vo.setValue(BigDecimal.ZERO);
......
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 to comment