xiaoyong931011
2020-06-23 8c7c2cadd5ec68b66b9a0c6afc0434c4513c1135
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package com.xcong.excoin.modules.systemSetting.service.Impl;
 
import java.util.Date;
 
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
 
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xcong.excoin.common.entity.FebsResponse;
import com.xcong.excoin.common.entity.QueryRequest;
import com.xcong.excoin.modules.systemSetting.entity.PlatformBannerEntity;
import com.xcong.excoin.modules.systemSetting.entity.PlatformNoticeEntity;
import com.xcong.excoin.modules.systemSetting.entity.PlatformSymbolsSkuEntity;
import com.xcong.excoin.modules.systemSetting.entity.PlatformTradeSettingEntity;
import com.xcong.excoin.modules.systemSetting.mapper.PlatformBannerMapper;
import com.xcong.excoin.modules.systemSetting.mapper.PlatformNoticeMapper;
import com.xcong.excoin.modules.systemSetting.mapper.PlatformSymbolsSkuMapper;
import com.xcong.excoin.modules.systemSetting.mapper.PlatformTradeSettingMapper;
import com.xcong.excoin.modules.systemSetting.service.SystemSettingService;
 
import lombok.RequiredArgsConstructor;
 
@Service
@RequiredArgsConstructor
public class SystemSettingServiceImpl extends ServiceImpl<PlatformTradeSettingMapper, PlatformTradeSettingEntity> implements SystemSettingService {
    
    private final PlatformTradeSettingMapper platformTradeSettingMapper;
    
    private final PlatformSymbolsSkuMapper platformSymbolsSkuMapper;
    
    private final PlatformBannerMapper platformBannerMapper;
    
    private final PlatformNoticeMapper platformNoticeMapper;
    
    @Override
    public IPage<PlatformTradeSettingEntity> findPlatformTradeSettingInPage(
            PlatformTradeSettingEntity platformTradeSettingEntity, QueryRequest request) {
        Page<PlatformTradeSettingEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<PlatformTradeSettingEntity> findmemberQuickBuySaleListInPage = platformTradeSettingMapper.findPlatformTradeSettingInPage(page, platformTradeSettingEntity);
        return findmemberQuickBuySaleListInPage;
    }
 
    @Override
    public PlatformTradeSettingEntity selectPlatformTradeSettingById(@NotNull(message = "{required}") long id) {
        PlatformTradeSettingEntity platformTradeSettingEntity = platformTradeSettingMapper.selectById(id);
        return platformTradeSettingEntity;
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse platformTradeSettingConfirm(@Valid PlatformTradeSettingEntity platformTradeSettingEntity) {
        platformTradeSettingMapper.updateById(platformTradeSettingEntity);
        return new FebsResponse().success();
    }
 
    @Override
    public IPage<PlatformSymbolsSkuEntity> findPlatformSymbolsSkuInPage(
            PlatformSymbolsSkuEntity platformSymbolsSkuEntity, QueryRequest request) {
        Page<PlatformSymbolsSkuEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<PlatformSymbolsSkuEntity> findmemberQuickBuySaleListInPage = platformSymbolsSkuMapper.findPlatformSymbolsSkuInPage(page, platformSymbolsSkuEntity);
        return findmemberQuickBuySaleListInPage;
    }
 
    @Override
    public PlatformSymbolsSkuEntity selectplatformSymbolsSkuById(@NotNull(message = "{required}") long id) {
        PlatformSymbolsSkuEntity platformSymbolsSkuEntity = platformSymbolsSkuMapper.selectById(id);
        return platformSymbolsSkuEntity;
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse platformSymbolsSkuConfirm(@Valid PlatformSymbolsSkuEntity platformSymbolsSkuEntity) {
        platformSymbolsSkuMapper.updateById(platformSymbolsSkuEntity);
        return new FebsResponse().success();
    }
 
    @Override
    public IPage<PlatformBannerEntity> findPlatformBannerInPage(PlatformBannerEntity platformBannerEntity,
            QueryRequest request) {
        Page<PlatformBannerEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<PlatformBannerEntity> platformBannerEntitys = platformBannerMapper.findPlatformBannerInPage(page, platformBannerEntity);
        return platformBannerEntitys;
    }
 
    @Override
    public PlatformBannerEntity selectPlatformBannerById(long id) {
        PlatformBannerEntity platformBannerEntity = platformBannerMapper.selectById(id);
        return platformBannerEntity;
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse platformBannerConfirm(@Valid PlatformBannerEntity platformBannerEntity) {
        platformBannerMapper.updateById(platformBannerEntity);
        return new FebsResponse().success();
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse platformBannerDelete(@NotNull(message = "{required}") Long id) {
        platformBannerMapper.deleteById(id);
        return new FebsResponse().success();
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void platformBannerAdd(@Valid PlatformBannerEntity platformBannerEntity) {
        PlatformBannerEntity platformBannerEntityAdd = new PlatformBannerEntity();
        platformBannerEntityAdd.setCreateBy("admin");
        platformBannerEntityAdd.setCreateTime(new Date());
        platformBannerEntityAdd.setImageUrl(platformBannerEntity.getImageUrl());
        platformBannerEntityAdd.setIsInside(platformBannerEntity.getIsInside());
        platformBannerEntityAdd.setIsJump(platformBannerEntity.getIsJump());
        platformBannerEntityAdd.setIsTop(platformBannerEntity.getIsTop());
        platformBannerEntityAdd.setJumpUrl(platformBannerEntity.getJumpUrl());
        platformBannerEntityAdd.setName(platformBannerEntity.getName());
        platformBannerEntityAdd.setShowPort(platformBannerEntity.getShowPort());
        platformBannerEntityAdd.setSort(platformBannerEntity.getSort());
        platformBannerEntityAdd.setUpdateBy("admin");
        platformBannerEntityAdd.setUpdateTime(new Date());
        platformBannerMapper.insert(platformBannerEntityAdd);
        
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse noticeManageConfirm(@Valid PlatformNoticeEntity platformNoticeEntity) {
        platformNoticeMapper.updateById(platformNoticeEntity);
        return new FebsResponse().success();
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse noticeManageDelete(@NotNull(message = "{required}") Long id) {
        platformNoticeMapper.deleteById(id);
        return new FebsResponse().success();
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void noticeManageAdds(@Valid PlatformNoticeEntity platformNoticeEntity) {
        PlatformNoticeEntity platformNoticeEntityAdd = new PlatformNoticeEntity();
        platformNoticeEntityAdd.setCreateTime(new Date());
        platformNoticeEntityAdd.setCategoryid(1);
        platformNoticeEntityAdd.setCategoryname("1");
        platformNoticeEntityAdd.setContent("1");
        platformNoticeEntityAdd.setSource(platformNoticeEntity.getSource());
        platformNoticeEntityAdd.setTitle(platformNoticeEntity.getTitle());
        platformNoticeMapper.insert(platformNoticeEntityAdd);
        
    }
 
    @Override
    public IPage<PlatformNoticeEntity> findNoticeManageInPage(PlatformNoticeEntity platformNoticeEntity,
            QueryRequest request) {
        Page<PlatformNoticeEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<PlatformNoticeEntity> platformBannerEntitys = platformNoticeMapper.findPlatformNoticeInPage(page, platformNoticeEntity);
        return platformBannerEntitys;
    }
 
    @Override
    public PlatformNoticeEntity selectNoticeManageById(long id) {
        PlatformNoticeEntity platformNoticeEntity = platformNoticeMapper.selectById(id);
        return platformNoticeEntity;
    }
 
 
}