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;
|
}
|
|
|
}
|