huliguo
2 天以前 5d7b65670282a4fad015e37d567cfa171b162052
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.ruoyi.errand.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.errand.domain.VipSetting;
import com.ruoyi.errand.mapper.VipSettingMapper;
import com.ruoyi.errand.object.dto.sys.SetPriceDTO;
import com.ruoyi.errand.object.vo.app.VipInfoListVO;
import com.ruoyi.errand.service.VipSettingService;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service
public class VipSettingServiceImpl extends ServiceImpl<VipSettingMapper, VipSetting> implements VipSettingService {
 
    @Override
    public List<VipInfoListVO> getVipInfoList() {
        return this.getBaseMapper().getVipInfoList();
    }
 
    @Override
    public void setPrice(SetPriceDTO setPriceDTO) {
        VipSetting byId = this.getById(setPriceDTO.getId());
        if (byId == null) {
            byId=new VipSetting();
            byId.setId(setPriceDTO.getId());
            if (setPriceDTO.getId()==1) byId.setVip_name("月卡会员");
            if (setPriceDTO.getId()==2) byId.setVip_name("季卡会员");
            if (setPriceDTO.getId()==3) byId.setVip_name("半年卡会员");
            if (setPriceDTO.getId()==4) byId.setVip_name("年卡会员");
            byId.setVip_price(setPriceDTO.getVip_price());
            this.save(byId);
        }else {
            byId.setVip_price(setPriceDTO.getVip_price());
            this.updateById(byId);
        }
 
    }
 
}