| | |
| | | public KeyOrder addKeyOrder(SubmitKeyInfo keyInfo, Long uid, String day) throws KeyOrderException, WxOrderCountException { |
| | | // 判断提交次数是否过量 |
| | | if (uid != null) { |
| | | WxUserSettings settings = wxUserSettingService.selectByUid(uid); |
| | | WxUserSettings settings = wxUserSettingService.getUserSettings(uid); |
| | | wxUserOrderCountService.addOrderCount(uid, OrderCountTypeEnum.SUBMIT_TOKEN_COUNT, day, 1, settings.getTotalOrderCountPerDay()); |
| | | } |
| | | String id = OrderFactory.createId(keyInfo.getKey()); |
| | |
| | | |
| | | @Override |
| | | public Long getCanDistributeUid() { |
| | | // 最近1小时有活跃 |
| | | List<OrderDistributeCountInfo> list = keyOrderMapper.listDistributeUids(new Date(System.currentTimeMillis() - 1000 * 60 * 60L)); |
| | | // 最近1小时有活跃,且不算12以上未执行的数据 |
| | | List<OrderDistributeCountInfo> list = keyOrderMapper.listDistributeUids(new Date(System.currentTimeMillis() - 1000 * 60 * 60L),new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 12L)); |
| | | if (list == null || list.size() == 0) { |
| | | return null; |
| | | } |