| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.configure.i18n.MessageSourceUtils; |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.common.utils.ShareCodeUtil; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.MemberOnHookPlanEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.ApiIgtOnHookPlanService; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.dapp.service.MemberOnHookPlan; |
| | | import cc.mrbird.febs.job.MineProfitJob; |
| | | import cn.hutool.core.codec.Base64; |
| | | 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.util.CharsetUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.crypto.asymmetric.KeyType; |
| | | import cn.hutool.crypto.asymmetric.RSA; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.jline.utils.Log; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.security.KeyPair; |
| | | import java.text.DecimalFormat; |
| | | import java.text.Format; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author |
| | | * @author |
| | | * @date 2022-03-28 |
| | | **/ |
| | | @SpringBootTest |
| | |
| | | // System.out.println(s); |
| | | // } |
| | | // |
| | | @Autowired |
| | | private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | @Test |
| | | public void getmember(){ |
| | | List<DataDictionaryCustom> dataDictionaryCustoms = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.PLAN_F.getType()); |
| | | LinkedList<Map<String,String>> strings = new LinkedList<>(); |
| | | for(DataDictionaryCustom dataDictionaryCustom : dataDictionaryCustoms){ |
| | | Map<String, String> stringStringHashMap = new HashMap<>(); |
| | | stringStringHashMap.put(dataDictionaryCustom.getDescription(),dataDictionaryCustom.getValue()); |
| | | strings.add(stringStringHashMap); |
| | | } |
| | | Map<String, LinkedList<String>> level_mb = MemberOnHookPlanEnum.valueOf("LEVEL_MB") |
| | | .getMemberOnHook(Double.valueOf(2),new BigDecimal(0.2),strings); |
| | | System.out.println(level_mb.toString()); |
| | | System.out.println(level_mb); |
| | | } |
| | | // @Autowired |
| | | // private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | // @Autowired |
| | | // private RedisUtils redisUtils; |
| | | // @Autowired |
| | | // private DappOnHookAwardDao dappOnHookAwardDao; |
| | | // @Test |
| | | // public void getmember(){//获取下一个开奖 |
| | | // String redisKey = "on_hook_award_id"; |
| | | // String onHookAwardRedisId = redisUtils.getString(redisKey); |
| | | // DappOnHookAward dappOnHookAward = dappOnHookAwardDao.selectById(Long.parseLong(onHookAwardRedisId)); |
| | | // if(ObjectUtil.isEmpty(dappOnHookAward)){ |
| | | // throw new FebsException(MessageSourceUtils.getString("login_err_003")); |
| | | // } |
| | | // Date awardTime = dappOnHookAward.getAwardTime(); |
| | | // System.out.println(awardTime); |
| | | // DateTime dateTime = DateUtil.offsetMinute(awardTime, 5); |
| | | // for(int i =1; i < 100;i++){ |
| | | // String yyyyMMddHHMM = DateUtil.format(dateTime, "yyyy-MM-dd HH:mm"); |
| | | //// DappOnHookAward dappOnHookAwardNext = dappOnHookAwardDao.selectByByAwardTime(yyyyMMddHHMM); |
| | | // System.out.println(yyyyMMddHHMM); |
| | | // dateTime = DateUtil.offsetMinute(dateTime, 5); |
| | | // } |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private DappMemberDao dappMemberDao; |
| | | // @Test |
| | | // public void getplan(){ |
| | | // DappMemberEntity dappMember = dappMemberDao.selectById(33); |
| | | // List<DataDictionaryCustom> dataDictionaryCustoms = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.PLAN_A.getType()); |
| | | // LinkedList<Map<String,String>> strings = new LinkedList<>(); |
| | | // for(DataDictionaryCustom dataDictionaryCustom : dataDictionaryCustoms){ |
| | | // Map<String, String> stringStringHashMap = new HashMap<>(); |
| | | // stringStringHashMap.put(dataDictionaryCustom.getDescription(),dataDictionaryCustom.getValue()); |
| | | // strings.add(stringStringHashMap); |
| | | // } |
| | | // //收益率 |
| | | // BigDecimal hangingRevenue = BigDecimal.ZERO; |
| | | // //挂机时长 |
| | | // DataDictionaryCustom maxHours = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MAX_HOURS.getType(), DataDictionaryEnum.MAX_HOURS.getCode()); |
| | | // if(ObjectUtil.isEmpty(maxHours)){ |
| | | // throw new FebsException(MessageSourceUtils.getString("login_err_003")); |
| | | // } |
| | | // |
| | | // Double maxHoursValue = Double.parseDouble(maxHours.getValue()); |
| | | // //获取用户信息的是否盈利字段 |
| | | // Integer isProfit = dappMember.getIsProfit() == null ? 1 : dappMember.getIsProfit(); |
| | | // String identity = null; |
| | | // if(isProfit == 2){ |
| | | // identity = "IS_PROFIT_NO"; |
| | | // }else{ |
| | | // identity = "LEVEL_MB"; |
| | | // DataDictionaryCustom levelMember = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.LEVEL_MB.getType(), dappMember.getIdentity()); |
| | | // if(ObjectUtil.isEmpty(levelMember)){ |
| | | // throw new FebsException(MessageSourceUtils.getString("login_err_003")); |
| | | // } |
| | | // String levelMemberValue = levelMember.getValue(); |
| | | // JSONObject levelMemberValueParse = JSONUtil.parseObj(levelMemberValue); |
| | | // hangingRevenue = new BigDecimal(levelMemberValueParse.get("hangingRevenue").toString()) |
| | | // .multiply(new BigDecimal(0.01)).setScale(4,BigDecimal.ROUND_DOWN); |
| | | // } |
| | | // //获取挂机字表的顺序 |
| | | // LinkedList<String> isProfitPlan = new LinkedList<>(); |
| | | // Map<String, LinkedList<String>> identity_level = MemberOnHookPlanEnum.valueOf(identity) |
| | | // .getMemberOnHook(maxHoursValue,hangingRevenue,strings); |
| | | // isProfitPlan = identity_level.get(identity); |
| | | // System.out.println(isProfitPlan); |
| | | // |
| | | // } |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private DappWalletCoinDao dappWalletCoinDao; |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private DappWalletCoinDao dappWalletCoinDao; |
| | | // |
| | | // @Test |
| | | // public void updateMemberLevel(){ |
| | | // Log.info("更新用户代理等级"); |
| | | // DateTime date = DateUtil.date(); |
| | | // //查询账户总金额大于51的有效用户 |
| | | // List<DappMemberEntity> dappMemberEntities = dappWalletCoinDao.selectTotalAmount(); |
| | | // if(CollUtil.isEmpty(dappMemberEntities)){ |
| | | // //没有账户金额大于51,则全部为会员 |
| | | // dappMemberDao.updateIdentity(); |
| | | // }else{ |
| | | // List<DappMemberEntity> LEVEL_IB = getMemberLevelList(dappMemberEntities, DataDictionaryEnum.LEVEL_MB.getCode(), DataDictionaryEnum.LEVEL_IB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_FIB = getMemberLevelList(LEVEL_IB, DataDictionaryEnum.LEVEL_IB.getCode(), DataDictionaryEnum.LEVEL_FIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_CIB = getMemberLevelList(LEVEL_FIB, DataDictionaryEnum.LEVEL_FIB.getCode(), DataDictionaryEnum.LEVEL_CIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_AIB = getMemberLevelList(LEVEL_CIB, DataDictionaryEnum.LEVEL_CIB.getCode(), DataDictionaryEnum.LEVEL_AIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_GIB = getMemberLevelList(LEVEL_AIB, DataDictionaryEnum.LEVEL_AIB.getCode(), DataDictionaryEnum.LEVEL_GIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_BP = getMemberLevelList(LEVEL_GIB, DataDictionaryEnum.LEVEL_GIB.getCode(), DataDictionaryEnum.LEVEL_BP.getCode()); |
| | | // List<DappMemberEntity> LEVEL_SP = getMemberLevelList(LEVEL_BP, DataDictionaryEnum.LEVEL_BP.getCode(), DataDictionaryEnum.LEVEL_SP.getCode()); |
| | | // List<DappMemberEntity> LEVEL_GP = getMemberLevelList(LEVEL_SP, DataDictionaryEnum.LEVEL_SP.getCode(), DataDictionaryEnum.LEVEL_GP.getCode()); |
| | | // } |
| | | // } |
| | | // |
| | | // private List<DappMemberEntity> getMemberLevelList(List<DappMemberEntity> dappMemberEntities,String identity,String identityNext){ |
| | | // List<DappMemberEntity> dappMemberEntitiesNext = new ArrayList<>(); |
| | | // if(CollUtil.isNotEmpty(dappMemberEntities)){ |
| | | // for(DappMemberEntity dappMemberEntity : dappMemberEntities){ |
| | | // Long memberEntityId = dappMemberEntity.getId(); |
| | | // String refererId = dappMemberEntity.getRefererId(); |
| | | // String inviteId = dappMemberEntity.getInviteId(); |
| | | // //下级是否存在三个账户总金额大于51的会员,并且代理等级为identity |
| | | // List<DappMemberEntity> levelMbMembers = dappMemberDao.selectTotalAmountByRefererIdAndIdentity(inviteId,identity); |
| | | // if(CollUtil.isNotEmpty(levelMbMembers) && 3 <= levelMbMembers.size()){ |
| | | // //设置identityNext级别 |
| | | // dappMemberDao.updateIdentityByMemberId(identityNext,memberEntityId); |
| | | // //获取他的上级会员信息 |
| | | // DappMemberEntity dappMemberEntityNext = dappMemberDao.selectMemberInfoByInviteId(refererId); |
| | | // dappMemberEntitiesNext.add(dappMemberEntityNext); |
| | | // } |
| | | // } |
| | | // } |
| | | // return dappMemberEntitiesNext; |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | // @Autowired |
| | | // private IgtOnHookPlanOrderItemDao igtOnHookPlanOrderItemDao; |
| | | // |
| | | // @Autowired |
| | | // private IgtOnHookPlanOrderDao igtOnHookPlanOrderDao; |
| | | // |
| | | // @Autowired |
| | | // private DappWalletCoinDao dappWalletCoinDao; |
| | | // |
| | | // @Autowired |
| | | // private DappAccountMoneyChangeDao dappAccountMoneyChangeDao; |
| | | // |
| | | // @Autowired |
| | | // private DappMemberDao dappMemberDao; |
| | | // |
| | | // @Autowired |
| | | // private DappOnHookAwardDao dappOnHookAwardDao; |
| | | // |
| | | // @Autowired |
| | | // private RedisUtils redisUtils; |
| | | // |
| | | // @Autowired |
| | | // private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | // |
| | | // @Autowired |
| | | // private DappWalletService dappWalletService; |
| | | // |
| | | // |
| | | // @Value("${spring.profiles.active}") |
| | | // private String active; |
| | | // |
| | | // @Autowired |
| | | // private ApiIgtOnHookPlanService apiIgtOnHookPlanService; |
| | | // |
| | | // @Test |
| | | // public void getActive(){ |
| | | // System.out.println(active); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void testUpdateIgt(){Log.info("更新用户代理等级"); |
| | | // DateTime date = DateUtil.date(); |
| | | // //查询账户总金额大于51的有效用户 |
| | | // List<DappMemberEntity> dappMemberEntities = dappWalletCoinDao.selectTotalAmount(); |
| | | // if(CollUtil.isEmpty(dappMemberEntities)){ |
| | | // //没有账户金额大于51,则全部为会员 |
| | | // dappMemberDao.updateIdentity(); |
| | | // }else{ |
| | | // List<DappMemberEntity> LEVEL_IB = getMemberLevelList(dappMemberEntities, DataDictionaryEnum.LEVEL_MB.getCode(), DataDictionaryEnum.LEVEL_IB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_FIB = getMemberLevelList(LEVEL_IB, DataDictionaryEnum.LEVEL_IB.getCode(), DataDictionaryEnum.LEVEL_FIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_CIB = getMemberLevelList(LEVEL_FIB, DataDictionaryEnum.LEVEL_FIB.getCode(), DataDictionaryEnum.LEVEL_CIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_AIB = getMemberLevelList(LEVEL_CIB, DataDictionaryEnum.LEVEL_CIB.getCode(), DataDictionaryEnum.LEVEL_AIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_GIB = getMemberLevelList(LEVEL_AIB, DataDictionaryEnum.LEVEL_AIB.getCode(), DataDictionaryEnum.LEVEL_GIB.getCode()); |
| | | // List<DappMemberEntity> LEVEL_BP = getMemberLevelList(LEVEL_GIB, DataDictionaryEnum.LEVEL_GIB.getCode(), DataDictionaryEnum.LEVEL_BP.getCode()); |
| | | // List<DappMemberEntity> LEVEL_SP = getMemberLevelList(LEVEL_BP, DataDictionaryEnum.LEVEL_BP.getCode(), DataDictionaryEnum.LEVEL_SP.getCode()); |
| | | // List<DappMemberEntity> LEVEL_GP = getMemberLevelList(LEVEL_SP, DataDictionaryEnum.LEVEL_SP.getCode(), DataDictionaryEnum.LEVEL_GP.getCode()); |
| | | // } |
| | | // } |
| | | // |
| | | // private List<DappMemberEntity> getMemberLevelList(List<DappMemberEntity> dappMemberEntities,String identity,String identityNext){ |
| | | // List<DappMemberEntity> dappMemberEntitiesNext = new ArrayList<>(); |
| | | // if(CollUtil.isNotEmpty(dappMemberEntities)){ |
| | | // for(DappMemberEntity dappMemberEntity : dappMemberEntities){ |
| | | // Long memberEntityId = dappMemberEntity.getId(); |
| | | // String refererId = dappMemberEntity.getRefererId(); |
| | | // String inviteId = dappMemberEntity.getInviteId(); |
| | | // //下级是否存在三个账户总金额大于51的会员,并且代理等级为identity |
| | | // List<DappMemberEntity> levelMbMembers = dappMemberDao.selectTotalAmountByRefererIdAndIdentity(inviteId,identity); |
| | | // if(CollUtil.isNotEmpty(levelMbMembers) && 3 <= levelMbMembers.size()){ |
| | | // //设置identityNext级别 |
| | | // dappMemberDao.updateIdentityByMemberId(identityNext,memberEntityId); |
| | | // //获取他的上级会员信息 |
| | | // DappMemberEntity dappMemberEntityNext = dappMemberDao.selectMemberInfoByInviteId(refererId); |
| | | // dappMemberEntitiesNext.add(dappMemberEntityNext); |
| | | // } |
| | | // } |
| | | // } |
| | | // return dappMemberEntitiesNext; |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void testProfitSharing(){ |
| | | // Log.info("开始更新挂机主表状态"); |
| | | // long current = DateUtil.currentSeconds(); |
| | | // Log.info("开始时间"+current); |
| | | // Log.info("开始更新挂机主表状态"); |
| | | // List<IgtOnHookPlanOrder> igtOnHookPlanOrders = igtOnHookPlanOrderDao.selectByState(3); |
| | | // if(CollUtil.isNotEmpty(igtOnHookPlanOrders)){ |
| | | // List<Long> ids = igtOnHookPlanOrderDao.selectIdsByState(3); |
| | | // //更新状态避免重复查询 |
| | | // igtOnHookPlanOrderDao.updateByIds(ids); |
| | | // for(IgtOnHookPlanOrder igtOnHookPlanOrder : igtOnHookPlanOrders){ |
| | | // Long memberId = igtOnHookPlanOrder.getMemberId(); |
| | | // BigDecimal planAmount = igtOnHookPlanOrder.getPlanAmount(); |
| | | // |
| | | // DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId); |
| | | // //获取收益率 |
| | | // DataDictionaryCustom identityDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.LEVEL_MB.getType(), dappMemberEntity.getIdentity()); |
| | | // String identityDicValue = identityDic.getValue(); |
| | | // JSONObject identityDicValueParse = JSONUtil.parseObj(identityDicValue); |
| | | // BigDecimal hangingRevenueLevel = new BigDecimal(identityDicValueParse.get("hangingRevenue").toString()) |
| | | // .multiply(new BigDecimal(0.01)).setScale(4,BigDecimal.ROUND_DOWN); |
| | | // //获取收益 |
| | | // BigDecimal totalProfit = planAmount.multiply(hangingRevenueLevel).setScale(4,BigDecimal.ROUND_DOWN); |
| | | // |
| | | // String refererIds = dappMemberEntity.getRefererIds(); |
| | | // List<String> refererIdList = StrUtil.split(refererIds, ",", -1, true, true); |
| | | // //生成流水佣金和盈利分成和流水记录,返回剩余盈利 |
| | | // BigDecimal profitSharingTotal = dappWalletService.updateLSYJYLFC(refererIdList, totalProfit); |
| | | // //平台分成,返回剩余盈利 |
| | | // BigDecimal systemTotal = dappWalletService.updatePTFC(memberId,totalProfit); |
| | | // totalProfit = totalProfit.subtract(profitSharingTotal).subtract(systemTotal); |
| | | // |
| | | // igtOnHookPlanOrder.setState(2); |
| | | // //一次挂机剩余的全部金额 |
| | | // BigDecimal totalMoney = totalProfit.add(planAmount); |
| | | // |
| | | // igtOnHookPlanOrder.setProfit(totalProfit); |
| | | // igtOnHookPlanOrderDao.updateById(igtOnHookPlanOrder); |
| | | // dappMemberEntity.setIsOnHook(3); |
| | | // dappMemberDao.updateById(dappMemberEntity); |
| | | // |
| | | // DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId); |
| | | // BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount(); |
| | | // dappWalletCoinDao.addTotalAndaddAvailableById(dappWalletCoinEntity.getId(),totalMoney); |
| | | // |
| | | // BigDecimal add = availableAmount.add(totalMoney); |
| | | // BigDecimal subtract = add.subtract(totalProfit); |
| | | // DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(memberId, subtract, totalProfit, add, "投注盈利", 5); |
| | | // dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity); |
| | | // } |
| | | // } |
| | | // |
| | | // Long totalTime=DateUtil.currentSeconds()-current; |
| | | // System.out.println("======消耗时间======="+totalTime+"ms"); |
| | | // |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void createAwardInfo(){ |
| | | // Log.info("挂机开奖记录"); |
| | | // /** |
| | | // * 每天跑一次,直接生成全部的记录 |
| | | // * 产生中奖记录 |
| | | // */ |
| | | // //每天开奖次数 288次 |
| | | // DateTime date = DateUtil.date(); |
| | | // |
| | | // String aWardTime = DateUtil.format(date, "yyyy-MM-dd"); |
| | | // DateTime aWardTimeStart = DateUtil.parseDateTime(aWardTime + " 00:00:00"); |
| | | //// DateTime dateTime = DateUtil.offsetMinute(aWardTimeStart, 5); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | // String yyyyMMdd = sdf.format(date); |
| | | // QueryWrapper<DappOnHookAward> dappOnHookAwardQueryWrapper = new QueryWrapper(); |
| | | // dappOnHookAwardQueryWrapper.like("record_num",yyyyMMdd); |
| | | // Integer selectCount = dappOnHookAwardDao.selectCount(dappOnHookAwardQueryWrapper); |
| | | // if(0 == selectCount){ |
| | | // Format formatCount = new DecimalFormat("000"); |
| | | // //一般都是将累加的数字当做一些单号的一部分,format要求string |
| | | // int dayMillise = (24 * 60) / 5; |
| | | // for(int i= 1;i <= dayMillise;i++){ |
| | | // DappOnHookAward dappOnHookAward = new DappOnHookAward(); |
| | | // int randomInt = RandomUtil.randomInt(10000, 99999); |
| | | // dappOnHookAward.setAwardNum(Integer.toString(randomInt)); |
| | | // dappOnHookAward.setState(2); |
| | | // String str = formatCount.format(i); |
| | | // dappOnHookAward.setRecordNum(yyyyMMdd+str); |
| | | // dappOnHookAward.setAwardTime(aWardTimeStart); |
| | | // dappOnHookAwardDao.insert(dappOnHookAward); |
| | | // aWardTimeStart = DateUtil.offsetMinute(aWardTimeStart, 5); |
| | | // } |
| | | // } |
| | | // |
| | | // DateTime tomorrow = DateUtil.tomorrow(); |
| | | // String tomorrowTime = DateUtil.format(tomorrow, "yyyy-MM-dd"); |
| | | // DateTime tomorrowTimeStart = DateUtil.parseDateTime(tomorrowTime + " 00:00:00"); |
| | | //// DateTime dateTime = DateUtil.offsetMinute(aWardTimeStart, 5); |
| | | // String tomorrowYyyyMMdd = sdf.format(tomorrow); |
| | | // QueryWrapper<DappOnHookAward> tomorrowYyyyMMddWrapper = new QueryWrapper(); |
| | | // tomorrowYyyyMMddWrapper.like("record_num",tomorrowYyyyMMdd); |
| | | // Integer tomorrowSelectCount = dappOnHookAwardDao.selectCount(tomorrowYyyyMMddWrapper); |
| | | // if(0 == tomorrowSelectCount){ |
| | | // Format formatCount = new DecimalFormat("000"); |
| | | // //一般都是将累加的数字当做一些单号的一部分,format要求string |
| | | // int dayMilliseT = (24 * 60) / 5; |
| | | // for(int i= 1;i <= dayMilliseT;i++){ |
| | | // DappOnHookAward dappOnHookAward = new DappOnHookAward(); |
| | | // int randomInt = RandomUtil.randomInt(10000, 99999); |
| | | // dappOnHookAward.setAwardNum(Integer.toString(randomInt)); |
| | | // dappOnHookAward.setState(2); |
| | | // String str = formatCount.format(i); |
| | | // dappOnHookAward.setRecordNum(tomorrowYyyyMMdd+str); |
| | | // dappOnHookAward.setAwardTime(tomorrowTimeStart); |
| | | // dappOnHookAwardDao.insert(dappOnHookAward); |
| | | // tomorrowTimeStart = DateUtil.offsetMinute(tomorrowTimeStart, 5); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | |
| | | |
| | | } |