| | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.crypto.asymmetric.KeyType; |
| | | import cn.hutool.crypto.asymmetric.RSA; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | |
| | | private final DappBankDao dappBankDao; |
| | | // private final DappMemberService dappMemberService; |
| | | private final DappMemberAddressDao dappMemberAddressDao; |
| | | private final IgtOnHookPlanOrderDao igtOnHookPlanOrderDao; |
| | | private final AppVersionMapper appVersionMapper; |
| | | |
| | | private final RedisTemplate<String, Object> redisTemplate; |
| | | |
| | |
| | | public IPage<DappMemberEntity> selectInPage(DappMemberEntity member, QueryRequest request) { |
| | | Page<DappMemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | User currentUser = FebsUtil.getCurrentUser(); |
| | | if (currentUser.getDeptId() == null) { |
| | | member.setCurrentUser(currentUser.getUserId()); |
| | | // if (currentUser.getDeptId() == null) { |
| | | // member.setCurrentUser(currentUser.getUserId()); |
| | | // } |
| | | if(StrUtil.isNotEmpty(currentUser.getDescription())){ |
| | | member.setDescription(currentUser.getDescription()); |
| | | } |
| | | return dappMemberDao.selectInPage(member, page); |
| | | } |
| | |
| | | int isOnHook = dappMemberEntity.getIsOnHook() == null ? 2 : dappMemberEntity.getIsOnHook(); |
| | | memberInfoVo.setIsOnHook(isOnHook); |
| | | |
| | | |
| | | BigDecimal totalProfit = igtOnHookPlanOrderDao.selectSumProfitByMemberId(memberId); |
| | | memberInfoVo.setTotalProfit(totalProfit.setScale(4,BigDecimal.ROUND_DOWN)); |
| | | |
| | | DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)){ |
| | | memberInfoVo.setTotalAmount(AppContants.INIT_MONEY); |
| | |
| | | return new FebsResponse().success().message(MessageSourceUtils.getString("Operation_001")); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<AppVersion> findAppVersion() { |
| | | return appVersionMapper.selectList(null); |
| | | } |
| | | |
| | | @Override |
| | | public AppVersion getAppVersionInfoById(long id) { |
| | | return appVersionMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AppVersion> getAppVersionList(AppVersion appVersion, QueryRequest request) { |
| | | Page<AppVersion> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AppVersion> appVersions = this.baseMapper.getAppVersionListInPage(page, appVersion); |
| | | return appVersions; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse delCategary(Long id) { |
| | | AppVersion appVersion = appVersionMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(appVersion)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); |
| | | } |
| | | appVersionMapper.deleteById(id); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse addAppVersion(AppVersion appVersion) { |
| | | appVersion.setCreatetime(new Date()); |
| | | appVersionMapper.insert(appVersion); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse updateAppVersion(AppVersion appVersion) { |
| | | AppVersion appVersionBefore = appVersionMapper.selectById(appVersion.getId()); |
| | | if(ObjectUtil.isEmpty(appVersionBefore)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); |
| | | } |
| | | appVersion.setCreatetime(new Date()); |
| | | appVersionMapper.updateById(appVersion); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MemberCoinChargeEntity> getChargeListInPage(MemberCoinChargeEntity memberCoinChargeEntity, QueryRequest request) { |
| | | Page<MemberCoinChargeEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<MemberCoinChargeEntity> memberCoinChargeEntityIPage = this.baseMapper.getChargeListInPage(page, memberCoinChargeEntity); |
| | | return memberCoinChargeEntityIPage; |
| | | } |
| | | |
| | | public String generateAsaToken(String token) { |
| | | RSA rsa = new RSA(null, AppContants.PUBLIC_KEY); |
| | | return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey); |
| | | } |
| | | |
| | | |
| | | } |