| | |
| | | if(ydProductVo.getSurplusT().compareTo(BigDecimal.ZERO) < 1) { |
| | | ydProductVo.setStatus(2); |
| | | } |
| | | |
| | | Integer shelvesDays = ydProductVo.getShelvesDays(); |
| | | String proUnit = ydProductVo.getProUnit(); |
| | | if(shelvesDays == 0){ |
| | | ydProductVo.setShelvesDaysStr("待定"); |
| | | }else{ |
| | | ydProductVo.setShelvesDaysStr(proUnit+"+"+shelvesDays); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | *产出规则 |
| | | */ |
| | | Date date = DateUtil.date(); |
| | | ydProductVo.setNowTime(date); |
| | | //上架天数 |
| | | Integer shelvesDays = ydProductVo.getShelvesDays(); |
| | | String proUnit = ydProductVo.getProUnit(); |
| | | if(shelvesDays == 0){ |
| | | ydProductVo.setGetType(2); |
| | | ydProductVo.setShelvesDaysStr("待定"); |
| | | }else{ |
| | | ydProductVo.setGetType(1); |
| | | ydProductVo.setShelvesDaysStr(proUnit+"+"+shelvesDays); |
| | | } |
| | | |
| | | Date date = DateUtil.date(); |
| | | ydProductVo.setNowTime(date); |
| | | Date workTime = DateUtil.offsetDay(date, shelvesDays); |
| | | ydProductVo.setWorkTime(workTime); |
| | | //服务周期 |
| | |
| | | |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | Long memberId = memberEntity.getId(); |
| | | // Long memberId = 442L; |
| | | // Long memberId = 447L; |
| | | OrderAllInfoVo orderAllInfoVo = new OrderAllInfoVo(); |
| | | DecimalFormat decimalFormat = new DecimalFormat("0.0000#"); |
| | | //历史总收益 |
| | |
| | | if(CollUtil.isNotEmpty(PowerNowQuery)){ |
| | | for(YdOrderEntity order : PowerNowQuery){ |
| | | int quantity = order.getQuantity(); |
| | | powerNow = powerNow + quantity; |
| | | Long productId = order.getProductId(); |
| | | YdProductEntity ydProductEntity = ydProductDao.selectById(productId); |
| | | if("XCH".equals(ydProductEntity.getCoin())){ |
| | | Integer proNum = ydProductEntity.getProNum(); |
| | | powerNow = powerNow + quantity*proNum; |
| | | } |
| | | } |
| | | } |
| | | orderAllInfoVo.setPowerNow(powerNow); |
| | |
| | | if(CollUtil.isNotEmpty(powerReradyQuerys)){ |
| | | for(YdOrderEntity order : powerReradyQuerys){ |
| | | int quantity = order.getQuantity(); |
| | | powerReady = powerReady + quantity; |
| | | Long productId = order.getProductId(); |
| | | YdProductEntity ydProductEntity = ydProductDao.selectById(productId); |
| | | if("XCH".equals(ydProductEntity.getCoin())){ |
| | | Integer proNum = ydProductEntity.getProNum(); |
| | | powerReady = powerReady + quantity*proNum; |
| | | } |
| | | } |
| | | } |
| | | orderAllInfoVo.setPowerReady(powerReady); |
| | |
| | | MemberWalletCoinEntity xch = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, "XCH"); |
| | | BigDecimal totalBalance = xch.getTotalBalance(); |
| | | BigDecimal subtractTotalBalance = totalBalance.subtract(xchNum); |
| | | if(BigDecimal.ZERO.compareTo(subtractTotalBalance) >= 0){ |
| | | if(BigDecimal.ZERO.compareTo(subtractTotalBalance) > 0){ |
| | | return Result.fail("XCH数量不足"); |
| | | } |
| | | |
| | | BigDecimal availableBalance = xch.getAvailableBalance(); |
| | | BigDecimal subtractAvailableBalance = availableBalance.subtract(xchNum); |
| | | if(BigDecimal.ZERO.compareTo(subtractAvailableBalance) >= 0){ |
| | | if(BigDecimal.ZERO.compareTo(subtractAvailableBalance) > 0){ |
| | | return Result.fail("XCH数量不足"); |
| | | } |
| | | //xch减少 |
| | |
| | | } |
| | | teamVo.setMemberNum(memberNum); |
| | | //购买总算力 |
| | | int allPower = ydOrderDao.selectAllPowerByMemberIdAndElse(inviteId); |
| | | |
| | | int allPower =0; |
| | | List<YdOrderEntity> ydOrderEntitys = ydOrderDao.selectListByMemberIdAndElse(inviteId); |
| | | if(CollUtil.isNotEmpty(ydOrderEntitys)){ |
| | | for(YdOrderEntity ydOrderEntity : ydOrderEntitys){ |
| | | Long productId = ydOrderEntity.getProductId(); |
| | | YdProductEntity ydProductEntity = ydProductDao.selectById(productId); |
| | | if("XCH".equals(ydProductEntity.getCoin())){ |
| | | Integer proNum = ydProductEntity.getProNum(); |
| | | Integer quantity = ydOrderEntity.getQuantity(); |
| | | allPower = allPower + proNum*quantity; |
| | | } |
| | | } |
| | | } |
| | | teamVo.setAllPower(allPower); |
| | | //详细列表 |
| | | Page<TeamInfoVo> page = new Page<>(teamInfoDto.getPageNum(), teamInfoDto.getPageSize()); |
| | |
| | | } |
| | | teamInfoVo.setMemberNum(memberNumInvite); |
| | | //下属团队总算力 |
| | | int powerNum = ydOrderDao.selectAllPowerByMemberIdAndElse(phone); |
| | | int powerNum =0; |
| | | List<YdOrderEntity> ydOrderEntityLevel = ydOrderDao.selectListByMemberIdAndElse(inviteId); |
| | | if(CollUtil.isNotEmpty(ydOrderEntityLevel)){ |
| | | for(YdOrderEntity ydOrderEntity : ydOrderEntityLevel){ |
| | | Long productId = ydOrderEntity.getProductId(); |
| | | YdProductEntity ydProductEntity = ydProductDao.selectById(productId); |
| | | if("XCH".equals(ydProductEntity.getCoin())){ |
| | | Integer proNum = ydProductEntity.getProNum(); |
| | | Integer quantity = ydOrderEntity.getQuantity(); |
| | | powerNum = powerNum + proNum*quantity; |
| | | } |
| | | } |
| | | } |
| | | teamInfoVo.setPowerNum(powerNum); |
| | | } |
| | | } |