| | |
| | | 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; |
| | |
| | | } |
| | | // 使用 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("关闭成功"); |
| | | } |
| | |
| | | @Override |
| | | public Result add(PrizeActivityForm form) { |
| | | PrizeActivity entity = PrizeActivityForm.getEntityByForm(form, null); |
| | | entity.setEnableStatus(PrizeActivityStatusEnum.OFF.name()); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | entity.setEnableStatus(PrizeActivityStatusEnum.OFF.name()); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public PrizeDetailVO prizeInfo(String id) { |
| | | return prizeActivityMapper.prizeInfo(id); |
| | | } |
| | | } |