| | |
| | | import cc.mrbird.febs.system.mapper.UserMapper; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.math.MathUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | List<MallMember> thirdLevelRecord = getStarRecord(fourLevelRecord, MemberLevelEnum.THIRD_LEVEL.name(), amount, orderNo, 0L,MoneyFlowTypeEnum.STAR_PERK_THREE.getValue()); |
| | | List<MallMember> secondLevelRecord = getStarRecord(thirdLevelRecord, MemberLevelEnum.SECOND_LEVEL.name(), amount, orderNo, 0L,MoneyFlowTypeEnum.STAR_PERK_TWO.getValue()); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Long number = 0L; // 这里可以替换成你需要检查的数字 |
| | | if (number % 3 == 0) { |
| | | System.out.println(number + " 可以被3整除"); |
| | | } else { |
| | | System.out.println(number + " 不能被3整除"); |
| | | } |
| | | } |
| | | @Override |
| | | public void BuyToSell() { |
| | | /** |
| | |
| | | BigDecimal profitPercent = mallProductNft.getProfit(); |
| | | for(MallProductBuy mallProductBuy : mallProductBuys){ |
| | | |
| | | |
| | | |
| | | Date payTime = mallProductBuy.getPayTime(); |
| | | |
| | | |
| | | // //偏移时间-- |
| | | // DateTime dateTime = DateUtil.offsetDay(payTime, cycle); |
| | | // int compare = DateUtil.compare(now, dateTime); |
| | | // if(compare >= 0){ |
| | | // mallProductBuy.setMateState(ProductEnum.PRODUCT_BUY_MATE_STATE_SUCCESS.getValue()); |
| | | // mallProductBuyMapper.updateById(mallProductBuy); |
| | | //偏移时间 |
| | | DateTime dateTime = DateUtil.offsetDay(payTime, cycle); |
| | | int compare = DateUtil.compare(now, dateTime); |
| | | if(compare >= 0){ |
| | | String s = String.valueOf(DateUtil.between(payTime, DateUtil.date(), DateUnit.DAY));//相差日期天数 |
| | | BigDecimal bigDecimal = new BigDecimal(s).setScale(0, BigDecimal.ROUND_DOWN);//只取整数位 |
| | | if(bigDecimal.compareTo(BigDecimal.ZERO) <= 0){ |
| | | continue; |
| | | } |
| | | BigDecimal remainder = bigDecimal.remainder(new BigDecimal(String.valueOf(cycle)));//取余 |
| | | if (remainder.compareTo(BigDecimal.ZERO) == 0) { |
| | | /** |
| | | * 更新买单状态 |
| | | * 收益生成一条卖单 |
| | | * 本金生成一条卖单 |
| | | */ |
| | | mallProductBuy.setMateState(ProductEnum.PRODUCT_BUY_MATE_STATE_SUCCESS.getValue()); |
| | | mallProductBuyMapper.updateById(mallProductBuy); |
| | | // mallProductBuy.setMateState(ProductEnum.PRODUCT_BUY_MATE_STATE_SUCCESS.getValue()); |
| | | // mallProductBuyMapper.updateById(mallProductBuy); |
| | | BigDecimal nftTotal = mallProductBuy.getNftTotal(); |
| | | BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01))); |
| | | // BigDecimal add = nftTotal.add(profit); |
| | | // insertSell(mallProductBuy.getMemberId(),add,add,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | BigDecimal add = nftTotal.add(profit); |
| | | insertSell(mallProductBuy.getMemberId(),add,add,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | insertSell(mallProductBuy.getMemberId(),profit,profit,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | // insertSell(mallProductBuy.getMemberId(),profit,profit,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | |
| | | /** |
| | |
| | | } |
| | | return list; |
| | | } |
| | | public static void main(String[] args) { |
| | | int[] nums = {1, 2, 2, 5, 2}; |
| | | List<Integer> missingNumbers = findDisappearedNumbers(nums); |
| | | System.out.println("缺失的数字为:" + missingNumbers); |
| | | } |
| | | // public static void main(String[] args) { |
| | | // int[] nums = {1, 2, 2, 5, 2}; |
| | | // List<Integer> missingNumbers = findDisappearedNumbers(nums); |
| | | // System.out.println("缺失的数字为:" + missingNumbers); |
| | | // } |
| | | |
| | | } |