| | |
| | | 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(); |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | String c2cUserId = ""; |
| | | User party = userService.getById(partyId); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("用户不存在"); |
| | | throw new YamiShopBindException("User does not exist"); |
| | | } |
| | | if (Arrays.asList(1, 2).contains(party.getC2cUserType())) { |
| | | C2cUser c2cUser = c2cUserService.getByPartyId(partyId); |
| | |
| | | //// page_no = "1"; |
| | | //// } |
| | | //// if (!StringUtils.isInteger(page_no)) { |
| | | //// throw new BusinessException("页码不是整数"); |
| | | //// throw new BusinessException("Page number must be an integer"); |
| | | //// } |
| | | //// if (Integer.valueOf(page_no).intValue() <= 0) { |
| | | //// throw new BusinessException("页码不能小于等于0"); |
| | | //// throw new BusinessException("Page number must be greater than 0"); |
| | | //// } |
| | | //// |
| | | //// int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | //// |
| | | //// String partyId = this.getLoginPartyId(); |
| | | //// if (null == partyId) { |
| | | //// throw new BusinessException("请重新登录"); |
| | | //// throw new BusinessException("Please log in again"); |
| | | //// } |
| | | //// |
| | | //// C2cUser c2cUser = this.c2cUserService.getByPartyId(partyId); |
| | | //// if (null == c2cUser) { |
| | | //// throw new BusinessException("承兑商不存在"); |
| | | //// throw new BusinessException("Merchant does not exist"); |
| | | //// } |
| | | //// |
| | | //// Integer on_sale_int = null; |
| | |
| | | //// page_no = "1"; |
| | | //// } |
| | | //// if (!StringUtils.isInteger(page_no)) { |
| | | //// throw new BusinessException("页码不是整数"); |
| | | //// throw new BusinessException("Page number must be an integer"); |
| | | //// } |
| | | //// if (Integer.valueOf(page_no).intValue() <= 0) { |
| | | //// throw new BusinessException("页码不能小于等于0"); |
| | | //// throw new BusinessException("Page number must be greater than 0"); |
| | | //// } |
| | | //// |
| | | //// int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | //// |
| | | //// String partyId = this.getLoginPartyId(); |
| | | //// if (null == partyId) { |
| | | //// throw new BusinessException("请重新登录"); |
| | | //// throw new BusinessException("Please log in again"); |
| | | //// } |
| | | //// |
| | | //// C2cUser c2cUser = this.c2cUserService.getByPartyId(partyId); |
| | | //// if (null == c2cUser) { |
| | | //// throw new BusinessException("承兑商不存在"); |
| | | //// throw new BusinessException("Merchant does not exist"); |
| | | //// } |
| | | //// |
| | | //// Page page = this.c2cAdvertService.pagedQuery(page_no_int, 20, c2cUser.getId().toString(), direction, "", "", "", null, 1, true); |
| | |
| | | String id = request.getParameter("id"); |
| | | String language = request.getParameter("language"); |
| | | if (StringUtils.isEmptyString(id)) { |
| | | throw new YamiShopBindException("C2C广告id不正确"); |
| | | throw new YamiShopBindException("C2CInvalid advert ID"); |
| | | } |
| | | C2cAdvert c2cAdvert = c2cAdvertService.getById(id); |
| | | if (null == c2cAdvert) { |
| | | throw new YamiShopBindException("广告不存在"); |
| | | throw new YamiShopBindException("Advert does not exist"); |
| | | } |
| | | C2cUser c2cUser = this.c2cUserService.getById(c2cAdvert.getC2cUserId()); |
| | | if (null == c2cUser) { |
| | | throw new YamiShopBindException("承兑商不存在"); |
| | | throw new YamiShopBindException("Merchant does not exist"); |
| | | } |
| | | User c2cParty = userService.getById(c2cUser.getC2cUserPartyId()); |
| | | if (null == c2cParty) { |
| | | throw new YamiShopBindException("承兑商的用户信息不存在"); |
| | | throw new YamiShopBindException("Merchant user info does not exist"); |
| | | } |
| | | Map<String, String> data = new HashMap<String, String>(); |
| | | data.put("id", c2cAdvert.getUuid().toString()); |
| | |
| | | // Map<String, String> currencyMap = this.c2cAdvertService.getCurrencyMap(); |
| | | // Map<String, String> symbolMap = this.c2cAdvertService.getSymbolMap(); |
| | | // if (StringUtils.isEmptyString(currency) || null == currencyMap || (null != currencyMap && !currencyMap.containsKey(currency))) { |
| | | // return "支付币种不正确"; |
| | | // return "Invalid payment currency"; |
| | | // } |
| | | // if (StringUtils.isEmptyString(symbol) || null == symbolMap || (null != symbolMap && !symbolMap.containsKey(symbol))) { |
| | | // return "上架币种不正确"; |
| | |
| | | // return "支付时效未填或格式不正确"; |
| | | // } |
| | | // if (StringUtils.isEmptyString(safeword)) { |
| | | // return "资金密码错误"; |
| | | // return "Incorrect fund password"; |
| | | // } |
| | | // return null; |
| | | // } |
| | |
| | | Map<String, String> currencyMap = this.c2cAdvertService.getCurrencyMap(); |
| | | Map<String, String> symbolMap = this.c2cAdvertService.getSymbolMap(); |
| | | if (!StringUtils.isEmptyString(currency) && null != currencyMap && !currencyMap.containsKey(currency)) { |
| | | return "支付币种不正确"; |
| | | return "Invalid payment currency"; |
| | | } |
| | | if (!StringUtils.isEmptyString(symbol) && null != symbolMap && !symbolMap.containsKey(symbol)) { |
| | | return "上架币种不正确"; |
| | |
| | | return "支付方式类型不正确"; |
| | | } |
| | | if (!StringUtils.isEmptyString(amount) && (!StringUtils.isDouble(amount) || Double.valueOf(amount).doubleValue() < 0)) { |
| | | return "支付金额不正确"; |
| | | return "Invalid payment amount"; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | // Map<String, String> currencyMap = this.c2cAdvertService.getCurrencyMap(); |
| | | // Map<String, String> symbolMap = this.c2cAdvertService.getSymbolMap(); |
| | | // if (!StringUtils.isEmptyString(currency) && null != currencyMap && !currencyMap.containsKey(currency)) { |
| | | // return "支付币种不正确"; |
| | | // return "Invalid payment currency"; |
| | | // } |
| | | // if (!StringUtils.isEmptyString(symbol) && null != symbolMap && !symbolMap.containsKey(symbol)) { |
| | | // return "上架币种不正确"; |