peng
4 天以前 9d54d50c7beb2e6f0baee23ad0d536eb53d89eec
framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeActivityServiceImpl.java
@@ -3,6 +3,7 @@
import cn.lili.common.utils.StringUtils;
import cn.lili.modules.lmk.domain.entity.ActivityRefPrize;
import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO;
import cn.lili.modules.lmk.domain.vo.PrizeDetailVO;
import cn.lili.modules.lmk.enums.general.PrizeActivityStatusEnum;
import cn.lili.modules.lmk.service.ActivityRefPrizeService;
import cn.lili.utils.COSUtil;
@@ -61,14 +62,12 @@
            }
            // 使用 list
        }
        if (PrizeActivityStatusEnum.OFF.getDescription().equals(prizeActivity.getEnableStatus())) {
            prizeActivity.setEnableStatus(PrizeActivityStatusEnum.ON.getDescription());
        if (PrizeActivityStatusEnum.OFF.name().equals(prizeActivity.getEnableStatus())) {
            prizeActivity.setEnableStatus(PrizeActivityStatusEnum.ON.name());
            baseMapper.updateById(prizeActivity);
            return Result.ok("启动成功");
        }else {
            prizeActivity.setEnableStatus(PrizeActivityStatusEnum.OFF.getDescription());
            prizeActivity.setEnableStatus(PrizeActivityStatusEnum.OFF.name());
            baseMapper.updateById(prizeActivity);
            return Result.ok("关闭成功");
        }
@@ -84,6 +83,7 @@
    @Override
    public Result add(PrizeActivityForm form) {
        PrizeActivity entity = PrizeActivityForm.getEntityByForm(form, null);
        entity.setEnableStatus(PrizeActivityStatusEnum.OFF.name());
        baseMapper.insert(entity);
        return Result.ok("添加成功");
    }
@@ -100,6 +100,7 @@
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        BeanUtils.copyProperties(form, entity);
        entity.setEnableStatus(PrizeActivityStatusEnum.OFF.name());
        baseMapper.updateById(entity);
        return Result.ok("修改成功");
    }
@@ -171,4 +172,9 @@
                .collect(Collectors.toList());
        return Result.ok().data(vos);
    }
    @Override
    public PrizeDetailVO prizeInfo(String id) {
        return prizeActivityMapper.prizeInfo(id);
    }
}