|
@@ -67,13 +67,13 @@ public class CouponMgrController extends BaseApiController {
|
|
|
|
|
|
@Autowired
|
|
|
private ICouponTicketService couponTicketService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ITicketBoxService ticketBoxService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ICouponChannelService couponChannelService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private IChannelService channelService;
|
|
|
|
|
@@ -102,8 +102,8 @@ public class CouponMgrController extends BaseApiController {
|
|
|
list = couponService.list(queryWrapper);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取代金券详情信息
|
|
|
*
|
|
@@ -116,8 +116,8 @@ public class CouponMgrController extends BaseApiController {
|
|
|
if (StringUtils.isBlank(couponId)){
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
- Coupon coupon = couponService.getById(couponId);
|
|
|
- if(null == coupon || StringUtils.isBlank(coupon.getCouponId())) {
|
|
|
+ Coupon coupon = couponService.getById(Long.valueOf(couponId));
|
|
|
+ if(null == coupon) {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
CouponVO couponVO = new CouponVO();
|
|
@@ -190,7 +190,7 @@ public class CouponMgrController extends BaseApiController {
|
|
|
ticketList.add(couponTicket);
|
|
|
}
|
|
|
}
|
|
|
-// if(coupon.getUseArea() != CouponUseAreaEnum.COMMON
|
|
|
+// if(coupon.getUseArea() != CouponUseAreaEnum.COMMON
|
|
|
// && ticketList.size() == 0) {
|
|
|
// return AjaxResult.error("使用范围为指定盲票时需要至少选择一种盲票");
|
|
|
// }
|
|
@@ -268,15 +268,15 @@ public class CouponMgrController extends BaseApiController {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
try {
|
|
|
- couponService.lambdaUpdate().set(Coupon::getStatus, CouponStatusEnum.PUT_ON.getValue().equals(status)?CouponStatusEnum.PUT_ON:CouponStatusEnum.PUT_OFF).eq(Coupon::getCouponId, couponId).update();
|
|
|
+ couponService.lambdaUpdate().set(Coupon::getStatus, CouponStatusEnum.PUT_ON.getValue().equals(status)?CouponStatusEnum.PUT_ON:CouponStatusEnum.PUT_OFF).eq(Coupon::getCouponId, Long.valueOf(couponId)).update();
|
|
|
// 查询代金券信息
|
|
|
} catch (Exception e) {
|
|
|
return AjaxResult.error("操作失败");
|
|
|
}
|
|
|
return AjaxResult.success("操作成功");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 删除代金券商品(假删)
|
|
|
*
|
|
@@ -289,8 +289,8 @@ public class CouponMgrController extends BaseApiController {
|
|
|
if (StringUtils.isBlank(couponId)){
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
- Coupon coupon = couponService.getById(couponId);
|
|
|
- if(null == coupon || StringUtils.isBlank(coupon.getCouponId())) {
|
|
|
+ Coupon coupon = couponService.getById(Long.valueOf(couponId));
|
|
|
+ if(null == coupon) {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
// 商品未下架, 不允许删除
|