| | |
| | | |
| | | if (null == cpmMap || 0 == cpmMap.size()) { |
| | | // TODO: 2023/4/16 |
| | | throw new YamiShopBindException("支付方式不存在"); |
| | | throw new YamiShopBindException("Payment method does not exist"); |
| | | } |
| | | List<String> cpmList = new ArrayList<String>(); |
| | | for (String key : cpmMap.keySet()) { |
| | |
| | | Object object = this.sessionTokenService.cacheGet(session_token); |
| | | this.sessionTokenService.del(session_token); |
| | | if (null == object || !userId.equals((String) object)) { |
| | | throw new YamiShopBindException("请稍后再试"); |
| | | throw new YamiShopBindException("Please try again later"); |
| | | } |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | if (null == partyId) { |
| | | throw new YamiShopBindException("请重新登录"); |
| | | throw new YamiShopBindException("Please log in again"); |
| | | } |
| | | User party = userService.getById(partyId); |
| | | if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) { |
| | | throw new YamiShopBindException("无权限"); |
| | | throw new YamiShopBindException("Permission denied"); |
| | | } |
| | | if (!party.isEnabled()) { |
| | | throw new YamiShopBindException("User is locked"); |
| | |
| | | party_kyc=new RealNameAuthRecord(); |
| | | } |
| | | if (!(party_kyc.getStatus() == 2) && "true".equals(this.sysparaService.find("withdraw_by_kyc").getSvalue())) { |
| | | throw new YamiShopBindException("无权限"); |
| | | throw new YamiShopBindException("Permission denied"); |
| | | } |
| | | HighLevelAuthRecord party_kycHighLevel = highLevelAuthRecordService.findByUserId(partyId); |
| | | if (party_kycHighLevel==null){ |
| | |
| | | } |
| | | double withdraw_by_high_kyc = Double.valueOf(this.sysparaService.find("withdraw_by_high_kyc").getSvalue()); |
| | | if (withdraw_by_high_kyc > 0 && coin_amount_double > withdraw_by_high_kyc && !(party_kycHighLevel.getStatus() == 2)) { |
| | | throw new YamiShopBindException("请先通过高级认证"); |
| | | throw new YamiShopBindException("Please complete advanced verification first"); |
| | | } |
| | | // if (!party.getWithdraw_authority()) { |
| | | // throw new BusinessException(1, "无权限"); |
| | |
| | | // 流水小于限额 |
| | | if (userdata_turnover < party_withdraw) { |
| | | fact_withdraw_amount = Arith.sub(party_withdraw, userdata_turnover); |
| | | throw new YamiShopBindException("流水小于限额"); |
| | | throw new YamiShopBindException("Turnover is below the limit"); |
| | | } |
| | | } |
| | | if ("2".equals(withdraw_limit_open_use_type)) { |
| | |
| | | Object obj1 = this.sysparaService.find("bank_card_order_cancel_day_times"); |
| | | if (null != obj1) { |
| | | if (orderCancelDayTimes >= Integer.valueOf(this.sysparaService.find("bank_card_order_cancel_day_times").getSvalue()).intValue()) { |
| | | throw new YamiShopBindException("今日取消订单次数太多了,请明日再试"); |
| | | throw new YamiShopBindException("Too many order cancellations today, please try again tomorrow"); |
| | | } |
| | | } |
| | | DecimalFormat df = new DecimalFormat("#.########"); |
| | | ExchangeRate ex = this.exchangeRateService.findBy(Constants.OUT_OR_IN_DEFAULT, currency.toUpperCase()); |
| | | if (null == ex) { |
| | | throw new YamiShopBindException("支付币种不正确"); |
| | | throw new YamiShopBindException("Invalid payment currency"); |
| | | } |
| | | C2cOrder c2cOrder = new C2cOrder(); |
| | | c2cOrder.setPartyId(party.getUserId()); |
| | |
| | | public Result orderCancel(String order_no, String remark) { |
| | | User party = userService.getById(SecurityUtils.getUser().getUserId()); |
| | | if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) { |
| | | throw new YamiShopBindException("无权限"); |
| | | throw new YamiShopBindException("Permission denied"); |
| | | } |
| | | if (!party.isEnabled()) { |
| | | throw new YamiShopBindException("User is locked"); |
| | | } |
| | | C2cOrder order = this.c2cOrderService.get(order_no); |
| | | if (null == order || !order.getPartyId().equals(SecurityUtils.getUser().getUserId())) { |
| | | throw new YamiShopBindException("订单不存在"); |
| | | throw new YamiShopBindException("Order does not exist"); |
| | | } |
| | | order.setRemark(remark); |
| | | // 用户不能取消提现 |
| | | if (SecurityUtils.getUser().getUserId().equals(order.getPartyId())) { |
| | | if ("withdraw".equals(order.getDirection())) { |
| | | throw new YamiShopBindException("用户不能取消提现"); |
| | | throw new YamiShopBindException("User cannot cancel withdrawal"); |
| | | } |
| | | this.c2cOrderService.saveOrderCancel(order, "user"); |
| | | } |
| | |
| | | public Result get(@RequestParam String order_no, @RequestParam String language) { |
| | | C2cOrder c2cOrder = this.c2cOrderService.get(order_no); |
| | | if (null == c2cOrder) { |
| | | throw new YamiShopBindException("订单不存在"); |
| | | throw new YamiShopBindException("Order does not exist"); |
| | | } |
| | | List<String> nos = new ArrayList<String>(); |
| | | nos.add(c2cOrder.getOrderNo()); |
| | |
| | | // c2cOrder.setUnreadMsg(unreadMsg.intValue()); |
| | | // } |
| | | 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); |
| | | } |
| | | // 多语言 |
| | |
| | | public Result list(String page_no, String direction, String state) { |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | if (null == partyId) { |
| | | throw new YamiShopBindException("请重新登录"); |
| | | throw new YamiShopBindException("Please log in again"); |
| | | } |
| | | if (StringUtils.isNullOrEmpty(page_no)) { |
| | | page_no = "1"; |
| | | } |
| | | if (!StringUtils.isInteger(page_no)) { |
| | | throw new YamiShopBindException("页码不是整数"); |
| | | throw new YamiShopBindException("Page number must be an integer"); |
| | | } |
| | | if (Integer.valueOf(page_no).intValue() <= 0) { |
| | | throw new YamiShopBindException("页码不能小于等于0"); |
| | | throw new YamiShopBindException("Page number must be greater than 0"); |
| | | } |
| | | int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | if (StringUtils.isNotEmpty(direction) && !Arrays.asList("recharge", "withdraw").contains(direction)) { |
| | | throw new YamiShopBindException("充值或提现不正确"); |
| | | throw new YamiShopBindException("Invalid deposit or withdrawal type"); |
| | | } |
| | | if (StringUtils.isNotEmpty(state) && !Arrays.asList("0", "3", "4").contains(state)) { |
| | | throw new YamiShopBindException("订单状态不正确"); |
| | | throw new YamiShopBindException("Invalid order status"); |
| | | } |
| | | Page page = this.c2cOrderService.pagedQuery(page_no_int, 20, direction, state, partyId); |
| | | if (null == page) { |