xiaoyong931011
2020-06-05 68bfb0e22f518b4f328ce96889f3dce0a80be560
20200605  代码提交
3 files modified
49 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java 37 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
@@ -161,4 +161,14 @@
        return orderCoinService.findCollectList();
    }
    
    /**
     * 币种搜索
     * @return
     */
    @ApiOperation(value = "币种搜索", notes = "币种搜索")
    @GetMapping(value = "/searchSymbolResultList")
    public Result  searchSymbolResultList() {
        return orderCoinService.searchSymbolResultList();
    }
}
src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java
@@ -29,4 +29,6 @@
    public Result findCollectList();
    public Result searchSymbolResultList();
}
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
@@ -13,9 +13,12 @@
import javax.annotation.Resource;
import com.xcong.excoin.modules.platform.entity.PlatformCnyUsdtExchangeEntity;
import com.xcong.excoin.modules.platform.entity.PlatformSymbolsCoinEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xcong.excoin.common.LoginUserUtils;
import com.xcong.excoin.common.enumerates.MemberWalletCoinEnum;
@@ -41,6 +44,7 @@
import com.xcong.excoin.modules.member.entity.MemberSelectSymbolsEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
import com.xcong.excoin.modules.platform.dao.PlatformCnyUsdtExchangeDao;
import com.xcong.excoin.modules.platform.dao.PlatformSymbolsCoinDao;
import com.xcong.excoin.modules.platform.dao.TradeSettingDao;
import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity;
import com.xcong.excoin.utils.CoinTypeConvert;
@@ -71,6 +75,8 @@
    MemberAccountFlowEntityDao memberAccountFlowEntityDao;
    @Resource
    RedisUtils redisUtils;
    @Resource
    PlatformSymbolsCoinDao platformSymbolsCoinDao;
    
    @Override
    public String generateSimpleSerialno(String userId) {
@@ -476,4 +482,35 @@
        return Result.ok(findCollectListVo);
    }
    @Override
    public Result searchSymbolResultList() {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        FindCollectListVo findCollectListVo = new FindCollectListVo();
        List<MemberSelectSymbolsVo> list = new ArrayList<>();
        Map<String, Object> columnMap = new HashMap<>();
        List<PlatformSymbolsCoinEntity> selectByMap = platformSymbolsCoinDao.selectByMap(columnMap);
        List<MemberSelectSymbolsEntity> selectSymbolByMemIdAndSymbol = memberSelectSymbolsDao.selectSymbolByMemId(memberId);
        for(PlatformSymbolsCoinEntity platformSymbolsCoinEntity : selectByMap) {
            MemberSelectSymbolsVo memberSelectSymbolsVo = new MemberSelectSymbolsVo();
            memberSelectSymbolsVo.setSymbol(platformSymbolsCoinEntity.getName());
            if(CollUtil.isNotEmpty(selectSymbolByMemIdAndSymbol)) {
                for(MemberSelectSymbolsEntity memberSelectSymbolsEntity : selectSymbolByMemIdAndSymbol) {
                    if(platformSymbolsCoinEntity.getName().equals(memberSelectSymbolsEntity.getSymbol())) {
                        memberSelectSymbolsVo.setIsCollect(MemberSelectSymbolsVo.ISCOLLECT_YES);
                    }else {
                        memberSelectSymbolsVo.setIsCollect(MemberSelectSymbolsVo.ISCOLLECT_NO);
                    }
                }
            }else {
                memberSelectSymbolsVo.setIsCollect(MemberSelectSymbolsVo.ISCOLLECT_NO);
            }
            list.add(memberSelectSymbolsVo);
        }
        findCollectListVo.setMemberSelectSymbolsVo(list);
        return Result.ok(findCollectListVo);
    }
}