| | |
| | | // 已用额度 |
| | | double weekWithdraw = this.weekWithdraw(user.getUserId()); |
| | | if (Arith.add(weekWithdraw, withdrawVolumn) > limit) { |
| | | throw new YamiShopBindException("提现不得大于限额"); |
| | | throw new YamiShopBindException("Withdrawal amount cannot exceed the limit."); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new YamiShopBindException("无权限"); |
| | | } |
| | | if (!party.isEnabled()) { |
| | | throw new YamiShopBindException("用户已锁定"); |
| | | throw new YamiShopBindException("User is locked"); |
| | | } |
| | | // 手续费 |
| | | double fee = 0; |
| | |
| | | } |
| | | String withdraw_limit = this.sysparaService.find("withdraw_limit").getSvalue(); |
| | | if (coin_amount_double < Double.valueOf(withdraw_limit)) { |
| | | throw new YamiShopBindException("提现不得小于限额"); |
| | | throw new YamiShopBindException("Withdrawal amount must not be less than the limit."); |
| | | } |
| | | String withdraw_limit_max = this.sysparaService.find("withdraw_limit_max").getSvalue(); |
| | | if (coin_amount_double > Double.valueOf(withdraw_limit_max)) { |
| | | throw new YamiShopBindException("提现不得大于限额"); |
| | | throw new YamiShopBindException("Withdrawal amount cannot exceed the limit."); |
| | | } |
| | | // 检测银行卡用户当日提现次数 |
| | | Object obj = this.sysparaService.find("bank_card_withdraw_limit_num"); |
| | |
| | | |
| | | if (bank_card_withdraw_limit_num > 0 && c2cOrders != null) { |
| | | if (c2cOrders.size() >= bank_card_withdraw_limit_num) { |
| | | throw new YamiShopBindException("当日可提现次数不足"); |
| | | throw new YamiShopBindException("The number of times funds can be withdrawn on the same day is insufficient."); |
| | | } |
| | | } |
| | | } |
| | |
| | | String[] withdraw_time = withdraw_limit_time.split("-"); |
| | | String dateString = sdf.format(date); |
| | | if (dateString.compareTo(withdraw_time[0]) < 0 || dateString.compareTo(withdraw_time[1]) > 0) { |
| | | throw new YamiShopBindException("不在可提现时间内"); |
| | | throw new YamiShopBindException("Not within the available withdrawal period"); |
| | | } |
| | | } |
| | | // 周提现额度限制开关 |
| | |
| | | throw new YamiShopBindException("无权限"); |
| | | } |
| | | if (!party.isEnabled()) { |
| | | throw new YamiShopBindException("用户已锁定"); |
| | | throw new YamiShopBindException("User is locked"); |
| | | } |
| | | C2cOrder order = this.c2cOrderService.get(order_no); |
| | | if (null == order || !order.getPartyId().equals(SecurityUtils.getUser().getUserId())) { |
| | |
| | | if (null == c2cOrder) { |
| | | throw new YamiShopBindException("订单不存在"); |
| | | } |
| | | |
| | | List<String> nos = new ArrayList<String>(); |
| | | nos.add(c2cOrder.getOrderNo()); |
| | | // TODO: 2023/4/15 |
| | | // Map<String, Integer> unreadMsgs =this.otcOnlineChatMessageService.unreadMsgsApi(nos); |
| | | // Integer unreadMsg = unreadMsgs.get(c2cOrder.getOrderNo()); |
| | | // if (null == unreadMsg) { |
| | | // c2cOrder.setUnreadMsg(0); |
| | | // } else { |
| | | // c2cOrder.setUnreadMsg(unreadMsg.intValue()); |
| | | // } |
| | | Map<String, Integer> unreadMsgs =this.otcOnlineChatMessageService.unreadMsgsApi(nos); |
| | | Integer unreadMsg = unreadMsgs.get(c2cOrder.getOrderNo()); |
| | | if (null == unreadMsg) { |
| | | c2cOrder.setUnreadMsg(0); |
| | | } else { |
| | | c2cOrder.setUnreadMsg(unreadMsg); |
| | | } |
| | | if (StringUtils.isNotEmpty(c2cOrder.getMethodImg())) { |
| | | String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + c2cOrder.getMethodImg(); |
| | | //String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + c2cOrder.getMethodImg(); |
| | | String path = Constants.IMAGES_HTTP + c2cOrder.getMethodImg(); |
| | | c2cOrder.setMethodImg(path); |
| | | } |
| | | // 多语言 |
| | |
| | | long nowTimestamp = (new Date()).getTime(); |
| | | long createTimestamp = c2cOrder.getCreateTime().getTime(); |
| | | long autoCancelSeconds = 0; |
| | | long remainSeconds = 0; |
| | | if ("0".equals(c2cOrder.getState())) { |
| | | autoCancelSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - createTimestamp); |
| | | remainSeconds = c2cOrder.getExpireTime() * 60 * 1000 * 2 - (nowTimestamp - createTimestamp); |
| | | } else if ("1".equals(c2cOrder.getState())) { |
| | | long payTimestamp = c2cOrder.getPayTime().getTime(); |
| | | autoCancelSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - createTimestamp); |
| | | remainSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - payTimestamp); |
| | | } |
| | | |
| | | c2cOrder.setAutoCancelTimeRemain((int) (autoCancelSeconds <= 0 ? 0 : autoCancelSeconds / 1000)); |
| | | c2cOrder.setExpireTimeRemain((int) (remainSeconds <= 0 ? 0 : remainSeconds / 1000)); |
| | | |
| | | if (c2cOrder.getC2cUserHeadImg() != null) { |
| | | c2cOrder.setC2cUserHeadImg(Constants.IMAGES_HTTP + c2cOrder.getC2cUserHeadImg()); |
| | | } |
| | | return Result.succeed(c2cOrder); |
| | | } |
| | | |
| | |
| | | throw new YamiShopBindException("页码不能小于等于0"); |
| | | } |
| | | int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | if (StringUtils.isNotEmpty(direction) && !Arrays.asList("recharge", "withdraw").contains(direction)) { |
| | | /*if (StringUtils.isNotEmpty(direction) && !Arrays.asList("recharge", "withdraw").contains(direction)) { |
| | | throw new YamiShopBindException("充值或提现不正确"); |
| | | } |
| | | if (StringUtils.isNotEmpty(state) && !Arrays.asList("0", "3", "4").contains(state)) { |
| | | throw new YamiShopBindException("订单状态不正确"); |
| | | } |
| | | }*/ |
| | | Page page = this.c2cOrderService.pagedQuery(page_no_int, 20, direction, state, partyId); |
| | | if (null == page) { |
| | | return Result.succeed(new ArrayList<Map<String, Object>>()); |