xiaoyong931011
2020-06-23 8c7c2cadd5ec68b66b9a0c6afc0434c4513c1135
src/main/java/com/xcong/excoin/modules/systemSetting/service/Impl/SystemSettingServiceImpl.java
@@ -1,9 +1,6 @@
package com.xcong.excoin.modules.systemSetting.service.Impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
@@ -17,9 +14,11 @@
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;
@@ -35,6 +34,8 @@
   private final PlatformSymbolsSkuMapper platformSymbolsSkuMapper;
   
   private final PlatformBannerMapper platformBannerMapper;
   private final PlatformNoticeMapper platformNoticeMapper;
   
   @Override
   public IPage<PlatformTradeSettingEntity> findPlatformTradeSettingInPage(
@@ -108,12 +109,9 @@
   @Override
   @Transactional(rollbackFor = Exception.class)
   public void platformBannerAdd() {
      Map<String, Object> columnMap= new HashMap<>();
      List<PlatformBannerEntity> selectByMap = platformBannerMapper.selectByMap(columnMap);
      PlatformBannerEntity platformBannerEntity = selectByMap.get(0);
   public void platformBannerAdd(@Valid PlatformBannerEntity platformBannerEntity) {
      PlatformBannerEntity platformBannerEntityAdd = new PlatformBannerEntity();
      platformBannerEntityAdd.setCreateBy(platformBannerEntity.getCreateBy());
      platformBannerEntityAdd.setCreateBy("admin");
      platformBannerEntityAdd.setCreateTime(new Date());
      platformBannerEntityAdd.setImageUrl(platformBannerEntity.getImageUrl());
      platformBannerEntityAdd.setIsInside(platformBannerEntity.getIsInside());
@@ -123,10 +121,53 @@
      platformBannerEntityAdd.setName(platformBannerEntity.getName());
      platformBannerEntityAdd.setShowPort(platformBannerEntity.getShowPort());
      platformBannerEntityAdd.setSort(platformBannerEntity.getSort());
      platformBannerEntityAdd.setUpdateBy(platformBannerEntity.getUpdateBy());
      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;
   }
}