xiaoyong931011
2021-05-26 2ee052764f200422a7fd3b4c2c90f731e614d0d2
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
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.AppVersionEntity;
import com.xcong.excoin.modules.systemSetting.entity.CommonConfigurationEntity;
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.AppVersionMapper;
import com.xcong.excoin.modules.systemSetting.mapper.CommonConfigurationMapper;
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;
    
    private final AppVersionMapper appVersionMapper;
    
    private final CommonConfigurationMapper commonConfigurationMapper;
    
    @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());
        String imageUrl = platformBannerEntity.getImageUrl();
        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.setIsBanner(platformBannerEntity.getIsBanner());
        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;
    }
 
    @Override
    public IPage<AppVersionEntity> findAppVersionEntityInPage(AppVersionEntity appVersionEntity, QueryRequest request) {
        Page<AppVersionEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<AppVersionEntity> appVersionEntitys = appVersionMapper.findAppVersionInPage(page, appVersionEntity);
        return appVersionEntitys;
    }
 
    @Override
    public AppVersionEntity selectAppVersionById(long id) {
        AppVersionEntity appVersionEntity = appVersionMapper.selectById(id);
        return appVersionEntity;
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse appVersionConfirm(@Valid AppVersionEntity appVersionEntity) {
        appVersionMapper.updateById(appVersionEntity);
        return new FebsResponse().success();
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse appVersionDelete(@NotNull(message = "{required}") Long id) {
        appVersionMapper.deleteById(id);
        return new FebsResponse().success();
    }
 
    @Override
    public void appVersionAdds(@Valid AppVersionEntity appVersionEntity) {
        AppVersionEntity appVersionEntitys = new AppVersionEntity();
        appVersionEntitys.setCreatetime(new Date());
        appVersionEntitys.setAddress(appVersionEntity.getAddress());
        appVersionEntitys.setContent(appVersionEntity.getContent());
        appVersionEntitys.setType(appVersionEntity.getType());
        appVersionEntitys.setVersion(appVersionEntity.getVersion()); 
        appVersionMapper.insert(appVersionEntitys);
        
    }
 
    @Override
    public IPage<CommonConfigurationEntity> findCommonConfigurationEntityInPage(
            CommonConfigurationEntity commonConfigurationEntity, QueryRequest request) {
 
        Page<CommonConfigurationEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<CommonConfigurationEntity> commonConfigurationEntitys = commonConfigurationMapper.findCommonConfigurationEntityInPage(page, commonConfigurationEntity);
        return commonConfigurationEntitys;
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void commonConfigurationAdd(@Valid CommonConfigurationEntity commonConfigurationEntity) {
        CommonConfigurationEntity commonConfiguration = new CommonConfigurationEntity();
        String name = commonConfigurationEntity.getName();
        String type = commonConfigurationEntity.getType();
        int state = commonConfigurationEntity.getState();
        String content = commonConfigurationEntity.getContent();
        String remarks = commonConfigurationEntity.getRemarks();
        commonConfiguration.setName(name);
        commonConfiguration.setType(type);
        commonConfiguration.setState(state);
        commonConfiguration.setContent(content);
        commonConfiguration.setRemarks(remarks);
        commonConfigurationMapper.insert(commonConfiguration);
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse commonConfigurationDelete(@NotNull(message = "{required}") Long id) {
        commonConfigurationMapper.deleteById(id);
        return new FebsResponse().success();
    }
 
    @Override
    public CommonConfigurationEntity selectCommonConfigurationById(long id) {
        return commonConfigurationMapper.selectById(id);
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public FebsResponse commonConfigurationUpdate(@Valid CommonConfigurationEntity commonConfigurationEntity) {
        commonConfigurationMapper.updateById(commonConfigurationEntity);
        return new FebsResponse().success();
    }
 
 
}