| | |
| | | //支付订单号 |
| | | private String payOrderNo; |
| | | //支付结果 1-成功2-失败 |
| | | private String payResult; |
| | | private Integer payResult; |
| | | |
| | | /** |
| | | * 状态;1-待支付2-已支付3-已取消 |
| | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * {"shareMinPercent":"0.00004","shareMaxPercent":"0.01","smallAchieve":"20000","teamPercent":"0.15","orderSalePercent":"0","lastAgentCnt":"0","buyMaxAmount","3000"} |
| | | * {"shareMinPercent":"0.00004","shareMaxPercent":"0.01","smallAchieve":"20000","teamPercent":"0.15","orderSalePercent":"0","lastAgentCnt":"0","buyMaxAmount":"3000"} |
| | | * {"shareMinPercent":"0.00005","shareMaxPercent":"0.012","smallAchieve":"60000","teamPercent":"0.3","orderSalePercent":"0","lastAgentCnt":"2","buyMaxAmount","3000"} |
| | | * {"shareMinPercent":"0.00006","shareMaxPercent":"0.014","smallAchieve":"200000","teamPercent":"0.45","orderSalePercent":"0","lastAgentCnt":"3","buyMaxAmount","3000"} |
| | | * {"shareMinPercent":"0.00007","shareMaxPercent":"0.016","smallAchieve":"600000","teamPercent":"0.60","orderSalePercent":"0","lastAgentCnt":"3","buyMaxAmount","3000"} |
| | |
| | | */ |
| | | @Getter |
| | | public enum FundFlowEnum { |
| | | //新增业绩 |
| | | ACHIEVE_ADD("ACHIEVE_ADD", 30), |
| | | //系统操作资产包 |
| | | SYSTEM_PACKAGE("SYSTEM_PACKAGE", 29), |
| | | //系统操作赠送积分 |
| | |
| | | int nodeType = 0; |
| | | // |
| | | if (!"asdf4321".equals(connectDto.getInviteId())) { |
| | | DappMemberEntity parent = dappMemberDao.selectByAddress(connectDto.getInviteId(), null); |
| | | DappMemberEntity parent = dappMemberDao.selectMemberInfoByInviteId(connectDto.getInviteId()); |
| | | if (parent == null) { |
| | | throw new FebsException("recommender is not exist"); |
| | | } |
| | |
| | | @Transactional |
| | | public Long createOrder(AddOrderDto addOrderDto) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | /** |
| | | * 1、商品是否上架 |
| | | * 2、用户余额是否足够 |
| | |
| | | @Transactional |
| | | public void cancelOrder(Long id) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(id); |
| | | if (ObjectUtil.isEmpty(orderInfo)) { |
| | | throw new FebsException("订单异常"); |
| | |
| | | @Transactional |
| | | public void payOrder(Long id) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(id); |
| | | if (ObjectUtil.isEmpty(orderInfo)) { |
| | | throw new FebsException("订单异常"); |
| | |
| | | String payOrderNo = MallUtils.getOrderNum("PAY"); |
| | | orderInfo.setPayOrderNo(payOrderNo); |
| | | orderInfo.setPayMethod("余额支付"); |
| | | orderInfo.setPayResult("成功"); |
| | | orderInfo.setPayResult(1); |
| | | orderInfo.setStatus(MallOrderInfo.STATUS_PAY); |
| | | mallOrderInfoMapper.updateById(orderInfo); |
| | | /** |
| | |
| | | BigDecimal.ZERO, |
| | | payOrderNo, |
| | | id); |
| | | dappFundFlowDao.insert(donateScoreFlow); |
| | | |
| | | /** |
| | | * 支付成功,消费后成有效账户后可分享(有效用户可推广) |
| | |
| | | memberId,amount,amount,DateUtil.date(),orderId,1,mallOrderInfo.getPayTime() |
| | | ); |
| | | mallAchieveRecordMapper.insert(mallAchieveRecord); |
| | | |
| | | DappFundFlowEntity achieveFlow = new DappFundFlowEntity( |
| | | memberId, |
| | | amount, |
| | | FundFlowEnum.ACHIEVE_ADD.getCode(), |
| | | 2, |
| | | BigDecimal.ZERO, |
| | | null, |
| | | orderId); |
| | | dappFundFlowDao.insert(achieveFlow); |
| | | /** |
| | | * 商城销售额1%-10%,可设定进入资产管理池 |
| | | * USDT_ORDER_PERCENT |
| | |
| | | DataDictionaryEnum.PACKAGE_SCORE_PRICE.getType(), |
| | | DataDictionaryEnum.PACKAGE_SCORE_PRICE.getCode() |
| | | ); |
| | | //卖出积分直接销毁。 |
| | | DataDictionaryCustom packageTotalScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getType(), |
| | | DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getCode() |
| | |
| | | packagePoorDic.setValue(avaPackagePoor.toString()); |
| | | dataDictionaryCustomMapper.updateById(packagePoorDic); |
| | | //计算当前价格 |
| | | BigDecimal divide = avaPackagePoor.divide(packageTotalScore, 2, BigDecimal.ROUND_DOWN); |
| | | BigDecimal divide = avaPackagePoor.divide(packageTotalScore, 8, BigDecimal.ROUND_DOWN); |
| | | packageScorePriceDic.setValue(divide.toString()); |
| | | dataDictionaryCustomMapper.updateById(packageScorePriceDic); |
| | | } |
| | |
| | | // === speed 代理升级 start === |
| | | @Bean |
| | | public DirectExchange speedLevelUpTeamExchange() { |
| | | return new DirectExchange(QueueEnum.SPEED_LEVEL_UP.getExchange()); |
| | | return new DirectExchange(QueueEnum.SPEED_LEVEL_UP_TEAM.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue speedLevelUpTeamQueue() { |
| | | return new Queue(QueueEnum.SPEED_LEVEL_UP.getQueue()); |
| | | return new Queue(QueueEnum.SPEED_LEVEL_UP_TEAM.getQueue()); |
| | | } |
| | | |
| | | @Bean |
| | |
| | | <script type="text/html" id="flow-type"> |
| | | {{# |
| | | var type = { |
| | | 4: {title: '入金,买入A币', color: 'orange'}, |
| | | 5: {title: '进入a底池', color: 'green'}, |
| | | 6: {title: '进入b底池', color: 'blue'}, |
| | | 7: {title: '50%客户秒到', color: 'orange'}, |
| | | 8: {title: '全网加权分红收益总量', color: 'green'}, |
| | | 9: {title: '10%直推', color: 'blue'}, |
| | | 10: {title: '5%节点-(超级节点收益总量)', color: 'orange'}, |
| | | 11: {title: '5%节点平分', color: 'green'}, |
| | | 12: {title: '5%基金会-(基金会收益总量)', color: 'blue'}, |
| | | 13: {title: '10%级差奖-(业绩奖收益总量)', color: 'orange'}, |
| | | 14: {title: '10%级差奖给会员', color: 'green'}, |
| | | 15: {title: 'dao3的全网分红', color: 'blue'}, |
| | | 16: {title: 'dao4的全网分红', color: 'orange'}, |
| | | 17: {title: 'dao5的全网分红', color: 'green'}, |
| | | 18: {title: 'dao5的平级全网分红', color: 'blue'}, |
| | | 19: {title: 'DAO 3节点收益', color: 'orange'}, |
| | | 20: {title: 'DAO 4节点收益', color: 'green'}, |
| | | 21: {title: 'DAO 5节点收益', color: 'blue'}, |
| | | 22: {title: 'DAO 5平级收益', color: 'orange'}, |
| | | 23: {title: '资产钱包转账到闪对钱包', color: 'green'}, |
| | | 24: {title: '资产钱包转账到闪对钱包手续费', color: 'blue'}, |
| | | 25: {title: '闪对钱包转USDT', color: 'orange'}, |
| | | 27: {title: '闪对钱包转USDT(USDT流水)', color: 'green'}, |
| | | 28: {title: '入金,买入AUSD币', color: 'blue'}, |
| | | 29: {title: '每小时燃烧', color: 'orange'}, |
| | | 30: {title: '20%全网加权分红剩余', color: 'green'}, |
| | | 1: {title: '赠送积分', color: 'orange'}, |
| | | 2: {title: '支付订单', color: 'green'}, |
| | | 3: {title: '静态补贴', color: 'blue'}, |
| | | 4: {title: '预期减少赠送积分', color: 'orange'}, |
| | | 5: {title: '预期增加余额', color: 'green'}, |
| | | 6: {title: '直推', color: 'blue'}, |
| | | 7: {title: '团队静态收益V1', color: 'orange'}, |
| | | 8: {title: '团队静态收益V2', color: 'green'}, |
| | | 9: {title: '团队静态收益V3', color: 'blue'}, |
| | | 10: {title: '团队静态收益V4', color: 'orange'}, |
| | | 11: {title: '团队静态收益V5', color: 'green'}, |
| | | 12: {title: '团队静态收益V6', color: 'blue'}, |
| | | 13: {title: '团队静态收益V7', color: 'orange'}, |
| | | 14: {title: '共享区加速V1', color: 'green'}, |
| | | 15: {title: '共享区加速V2', color: 'blue'}, |
| | | 16: {title: '共享区加速V3', color: 'orange'}, |
| | | 17: {title: '共享区加速V4', color: 'green'}, |
| | | 18: {title: '共享区加速V5', color: 'blue'}, |
| | | 19: {title: '共享区加速V6', color: 'orange'}, |
| | | 20: {title: '共享区加速V7', color: 'green'}, |
| | | 21: {title: '实际减少赠送积分', color: 'blue'}, |
| | | 22: {title: '实际增加余额', color: 'orange'}, |
| | | 23: {title: '卖出资产', color: 'green'}, |
| | | 24: {title: '卖出资产获得余额', color: 'blue'}, |
| | | 25: {title: '卖出资产手续费', color: 'orange'}, |
| | | 26: {title: '每日获取金额(前端提示记录)', color: 'orange'}, |
| | | 27: {title: '系统操作余额', color: 'green'}, |
| | | 28: {title: '系统操作赠送积分', color: 'blue'}, |
| | | 29: {title: '系统操作资产包', color: 'orange'}, |
| | | 30: {title: '新增业绩', color: 'green'}, |
| | | 31: {title: 'AUSDT互转', color: 'blue'}, |
| | | 32: {title: 'ANDAO互转', color: 'orange'}, |
| | | 33: {title: '权益额度增加', color: 'green'}, |
| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.dapp.dto.AddOrderDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cn.hutool.core.codec.Base64; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUnit; |
| | |
| | | **/ |
| | | @SpringBootTest |
| | | public class JunitTest { |
| | | |
| | | // @Autowired |
| | | // private DappMemberDao dappMemberDao; |
| | | // |
| | |
| | | // public String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1cHrcMpXoKNC8rjAa/jAbgU2bhIBmJmn6iYDfqt0Him/p2s5F0L9nfzZOLYlPq3z12zvXl9IgThhtLIBLi86RPW0ljuwpTvIZz9O36Zae9eMk5bMNsFEFsxg1IOLIM2Oc4ffNvGL58Uupp9RL5NCN1MRQyY61ISy7H2VRTznoJQIDAQAB"; |
| | | // public String PRIVATE_KEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVwetwylego0LyuMBr+MBuBTZuEgGYmafqJgN+q3QeKb+nazkXQv2d/Nk4tiU+rfPXbO9eX0iBOGG0sgEuLzpE9bSWO7ClO8hnP07fplp714yTlsw2wUQWzGDUg4sgzY5zh9828YvnxS6mn1Evk0I3UxFDJjrUhLLsfZVFPOeglAgMBAAECgYAPKWWS5gVB37tFsRajAs+5VK5MCyABqT8c6QWkay5KNYbRl2+6RM3h068RjFuXlUB9eQMAqpasDWqcIOZdqcKqmxm0ILF2zfPzJr4RaQNSNwDCVrKEeaDtrZQcq/0ygaNDF9y203UMHT0dfEQSGp/xkjTgXNsOuC9iLM56XScOVwJBAPOZLbrCi0h4PL7g3rWsCw8/aN6ehkJ3iTDgjYpdBwJOJSyxV0qi0xmDthGqPd99Kvc14u1jy3ghpm1SAEunrj8CQQC+rS6qajIkK7NiRmX43chDhgMPGo0UFHbmHyYBb1Eyrxu1MNWQEh221p54GsB2HqAGRhxxQ98Ds2S26Au7QpibAkA2nQAAn/8kFzjfPoEPz+uG1puHVZkaK7yJRb7V53dbz/NLqtK8O/cCAGKAYV+PzHsmg2FGAZqrazfpyHmifIx3AkBnFau/+A/JnFKr09F3XTfSwZXPyZPyAipRuQ9MAUmNtDuvloovDIxB9//OgPACLAZpvefMmFvuXUMa25LUF2n3AkBGb+vO+69NSyQM2SHKZ9fUrxx9ZPhupNt/TXNL9OMEQiLaHCYgg0tfcojGe3QjBCA6wVG+dCyZUcv5OwiW23pI"; |
| | | // |
| | | // @Test |
| | | // public void encodeTest() { |
| | | // RSA rsa = new RSA(AppContants.REQ_PRIVATE_KEY, AppContants.REQ_PUBLIC_KEY); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("test", 123); |
| | | // String s = JSONObject.toJSONString(map); |
| | | // String s1 = rsa.encryptBase64(s, KeyType.PublicKey); |
| | | // System.out.println(s1); |
| | | // } |
| | | @Autowired |
| | | private DappMemberService dappMemberService; |
| | | @Autowired |
| | | private DappSystemService dappSystemService; |
| | | /** |
| | | * 创建订单 |
| | | */ |
| | | @Test |
| | | public void createOrder() { |
| | | AddOrderDto addOrderDto = new AddOrderDto(); |
| | | addOrderDto.setGoodsCnt(10); |
| | | addOrderDto.setGoodsId(61L); |
| | | Long orderId = dappMemberService.createOrder(addOrderDto); |
| | | System.out.println(orderId); |
| | | } |
| | | |
| | | /** |
| | | * 取消订单 |
| | | */ |
| | | @Test |
| | | public void encodeTest() { |
| | | |
| | | dappMemberService.cancelOrder(1L); |
| | | } |
| | | |
| | | /** |
| | | * 支付订单 |
| | | */ |
| | | @Test |
| | | public void payOrder() { |
| | | |
| | | dappMemberService.payOrder(4L); |
| | | } |
| | | @Test |
| | | public void test(){ |
| | | /** |
| | | * 加速团队静态收益的70%(业绩全算) |
| | | * 加速团队静态收益为极差制,平级10% |
| | | * 如V1加速团队静态收益的15%=每日静态的20000*6‰*15%=18元的额外释放加速 |
| | | * 共享区加速万分之5,上限1.8%(按本金计) |
| | | */ |
| | | dappSystemService.teamStaticPerk(); |
| | | /** |
| | | * 每天按照消费金额的5‰静释放(千分之五的静态释放比例) |
| | | * (按购买顺序结算,同时有5个订单就有结算记录) |
| | | * (设置多少,全部按照最新的来释放) |
| | | */ |
| | | dappSystemService.memberPerk(); |
| | | /** |
| | | * 直推消费分享:享受直接分享人每日消费金额释放的100%加速; |
| | | */ |
| | | dappSystemService.directMemberPerk(); |
| | | /** |
| | | * 实际更新账户业绩余额和积分 |
| | | */ |
| | | dappSystemService.updateAchieve(); |
| | | } |
| | | // |
| | | // @Test |
| | | // public void decodeTest() { |