|
|
@@ -70,9 +70,9 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
wrapper.orderByDesc("coupon.created_time");
|
|
|
IPage<LifeCouponVo> lifeCouponVo = platformStoreCouponMapper.getCouponList(new Page<>(page, size), wrapper);
|
|
|
lifeCouponVo.getRecords().forEach(item -> {
|
|
|
- if (item.getStatus() == -1) {
|
|
|
+ if (item.getStatus() == 1) {
|
|
|
item.setStatusName("待审核");
|
|
|
- } else if (item.getStatus() == -2) {
|
|
|
+ } else if (item.getStatus() == 3) {
|
|
|
item.setStatusName("已拒绝");
|
|
|
} else {
|
|
|
item.setStatusName("已通过");
|
|
|
@@ -145,8 +145,6 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
public IPage<LifeCouponVo> getCouponStatusList(Integer page, Integer size, String status, String expiredState) {
|
|
|
IPage<LifeCouponVo> iPage = new Page<>(page, size);
|
|
|
QueryWrapper<LifeCouponVo> wrapper = new QueryWrapper<>();
|
|
|
- // 定义允许的状态值
|
|
|
- List<String> allowedStatus = Arrays.asList("1", "2", "3");
|
|
|
if ("-3".equals(status)) { // 已售罄(逻辑状态,状态为进行中但是余量为0的)
|
|
|
wrapper.eq("coupon.status", "1");
|
|
|
wrapper.eq("coupon.stock_qty", 0);
|
|
|
@@ -227,14 +225,14 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
|
|
|
@Override
|
|
|
public int approvalCoupon(Integer id, Integer status, String comment, String type) {
|
|
|
- if (type.equals("0")) {
|
|
|
+ if (type.equals("1")) {
|
|
|
LifeCoupon coupon = platformStoreCouponMapper.selectById(id);
|
|
|
if (null == coupon) return 0;
|
|
|
|
|
|
// 如果通过,且券有效时间在当前时间之前,则修改状态为进行中
|
|
|
Date now = new Date();
|
|
|
- if (status == 0 && coupon.getStartDate().before(now) && coupon.getEndDate().after(now)) {
|
|
|
- status = 1;
|
|
|
+ if (status == 2 && coupon.getStartDate().before(now) && coupon.getEndDate().after(now)) {
|
|
|
+ status = 5;
|
|
|
}
|
|
|
|
|
|
coupon.setStatus(status);
|
|
|
@@ -291,13 +289,13 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
|
|
|
List<LifeCouponVo> lifeCouponVo = platformStoreCouponMapper.getCouponList(wrapper);
|
|
|
lifeCouponVo.forEach(item -> {
|
|
|
- if (item.getStatus() == 1 && item.getStockQty() > 0) {
|
|
|
+ if (item.getStatus() == 5 && item.getStockQty() > 0) {
|
|
|
item.setCouponState("进行中");
|
|
|
- } else if (item.getStatus() == 1 && item.getStockQty() == 0) {
|
|
|
+ } else if (item.getStatus() == 5 && item.getStockQty() == 0) {
|
|
|
item.setCouponState("已售罄");
|
|
|
- } else if (item.getStatus() == 2) {
|
|
|
+ } else if (item.getStatus() == 6) {
|
|
|
item.setCouponState("已暂停");
|
|
|
- } else if (item.getStatus() == 3) {
|
|
|
+ } else if (item.getStatus() == 7) {
|
|
|
item.setCouponState("已结束");
|
|
|
}
|
|
|
item.setCouponName(item.getName());
|