| | |
| | | |
| | | StockDz stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("id", userPositionCheckDz.getDzId())); |
| | | |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN", user.getId()); |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("US", user.getId()); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("用户账户有待补资金未补齐,审核失败"); |
| | | } |
| | |
| | | userPosition.setId(null); |
| | | userPosition.setDzId(stockDz.getId()); |
| | | userPositionMapper.insert(userPosition); |
| | | userAssetsServices.availablebalanceChange(EStockType.IN.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"",""); |
| | | userAssetsServices.availablebalanceChange(EStockType.US.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"",""); |
| | | return ServerResponse.createBySuccessMsg("审核成功,订单已转客户持仓"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | User user = this.iUserService.getCurrentRefreshUser(request); |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN", user.getId()); |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("US", user.getId()); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("请先缴清待补资金", request); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | US("US","美国股票","5",PropertiesUtil.getProperty("US_HTTP_API"),PropertiesUtil.getProperty("US_KEY"),"USD","$"), |
| | | HK("HK","香港股票","39",PropertiesUtil.getProperty("HK_HTTP_API"),PropertiesUtil.getProperty("HK_KEY"),"HKD","HK$"), |
| | | MAS("MAS","马来西亚股票","42",PropertiesUtil.getProperty("MAS_HTTP_API"),PropertiesUtil.getProperty("MAS_KEY"),"MYR","RM"), |
| | | |
| | | IN("IN","印度股票","14", PropertiesUtil.getProperty("JS_IN_HTTP_URL"),PropertiesUtil.getProperty("JS_IN_KEY"),"INR","₹"); |
| | | US("US","美国股票","5",PropertiesUtil.getProperty("US_HTTP_API"),PropertiesUtil.getProperty("US_KEY"),"USD","$"); |
| | | // HK("HK","香港股票","39",PropertiesUtil.getProperty("HK_HTTP_API"),PropertiesUtil.getProperty("HK_KEY"),"HKD","HK$"), |
| | | // MAS("MAS","马来西亚股票","42",PropertiesUtil.getProperty("MAS_HTTP_API"),PropertiesUtil.getProperty("MAS_KEY"),"MYR","RM"), |
| | | // |
| | | // IN("IN","印度股票","14", PropertiesUtil.getProperty("JS_IN_HTTP_URL"),PropertiesUtil.getProperty("JS_IN_KEY"),"INR","₹"); |
| | | // TH("TH","泰国股票","41",PropertiesUtil.getProperty("TH_HTTP_API"),PropertiesUtil.getProperty("TH_KEY")), |
| | | // HG("HG","韩国股票","11",PropertiesUtil.getProperty("HG_HTTP_API"),PropertiesUtil.getProperty("HG_KEY")), |
| | | // SZHB("SZHB","数字货币","41",PropertiesUtil.getProperty("SZHB_HTTP_API"),PropertiesUtil.getProperty("SZHB_KEY")); |
| | |
| | | } |
| | | |
| | | public static EStockType getEStockTypeByCode(String code){ |
| | | if(EStockType.US.getCode().equals(code)){ |
| | | if(EStockType.US.getCode().equals(code)) { |
| | | return US; |
| | | |
| | | }else if(EStockType.HK.getCode().equals(code)){ |
| | | return HK; |
| | | }else if(EStockType.MAS.getCode().equals(code)){ |
| | | return MAS; |
| | | }else if(EStockType.IN.getCode().equals(code)){ |
| | | return IN; |
| | | }else{ |
| | | return MAS; |
| | | } |
| | | // }else if(EStockType.HK.getCode().equals(code)){ |
| | | // return HK; |
| | | // }else if(EStockType.MAS.getCode().equals(code)){ |
| | | // return MAS; |
| | | // }else if(EStockType.IN.getCode().equals(code)){ |
| | | // return IN; |
| | | // }else{ |
| | | // return MAS; |
| | | // } |
| | | return US; |
| | | } |
| | | |
| | | public String getContryId() { |
| | |
| | | |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>() |
| | | .eq(UserAssets::getUserId, orderEchoBean.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().subtract(money)); |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(money)); |
| | |
| | | BigDecimal aml = incomeAmount.add(money); |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>() |
| | | .eq(UserAssets::getUserId, orderEchoBean.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | if (userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0) { |
| | | continue; |
| | |
| | | } |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<>(UserAssets.class) |
| | | .eq(UserAssets::getUserId, paymentRecharge.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getOriAmount().toString(), "2"); |
| | | if(serverResponse.getStatus() == 0){ |
| | |
| | | |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<>(UserAssets.class) |
| | | .eq(UserAssets::getUserId, paymentRecharge.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | // ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getTotal_fee().toString(), "2"); |
| | | userAssetsServices.availablebalanceChange(EStockType.IN.getCode(), |
| | | userAssetsServices.availablebalanceChange(EStockType.US.getCode(), |
| | | paymentRecharge.getUserId(), EUserAssets.TOP_UP,new BigDecimal(vo.getTotal_fee().toString()),"",""); |
| | | |
| | | paymentRecharge.setStatus(2); |
| | |
| | | List<Stock> stockList = new ArrayList<>(); |
| | | if (stockType.equals("99")) { |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | stockList.addAll(stockMapper.findZtStockListByKeyWords(keyWords, stockPlate, "IN", Integer.valueOf(0))); |
| | | stockList.addAll(stockMapper.findZtStockListByKeyWords(keyWords, stockPlate, "US", Integer.valueOf(0))); |
| | | } else if (stockType.equals("100")) { |
| | | User user = iUserService.getCurrentRefreshUser(request); |
| | | if (user == null) { |
| | |
| | | Gson gson = new Gson(); |
| | | List<kData> dataList = gson.fromJson(object.toString(), new TypeToken<List<kData>>(){}.getType()); |
| | | |
| | | Stock stock = stockMapper.selectOne(new LambdaQueryWrapper<Stock>().eq(Stock::getStockCode, pid).eq(Stock::getStockType, "IN")); |
| | | Stock stock = stockMapper.selectOne(new LambdaQueryWrapper<Stock>().eq(Stock::getStockCode, pid).eq(Stock::getStockType, "US")); |
| | | BigDecimal nowPrice = iPriceServices.getNowPrice(stock.getStockCode()); |
| | | Map singleStock = getSingleStock(stock.getStockCode()); |
| | | StockVO stockVO = (StockVO)singleStock.get("stock"); |
| | |
| | | @Override |
| | | public Boolean timeCheck(String stockCode) { |
| | | StockSetting stockSetting = stockSettingMapper.selectOne(new QueryWrapper<StockSetting>().eq("stock_code",stockCode)); |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type","IN")); |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type","US")); |
| | | if(stockSetting!= null){ |
| | | // 说明进入盘前交易或者盘后交易时间 |
| | | Date newDate = new Date(); |
| | |
| | | |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>() |
| | | .eq(UserAssets::getUserId, userPosition.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("请先缴清待补资金", request); |
| | |
| | | // StringBuffer gid = new StringBuffer(); |
| | | // gid.append(stockSubscribe.getStockType()!=null?stockSubscribe.getStockType():""); |
| | | // gid.append(userStockSubscribe.getNewCode()!=null?userStockSubscribe.getNewCode():"stock code invaild"); |
| | | userPosition.setStockGid("IN"); |
| | | userPosition.setStockGid("US"); |
| | | userPosition.setBuyOrderId(GeneratePosition.getPositionId()); |
| | | userPosition.setBuyOrderTime(new Date()); |
| | | userPosition.setBuyOrderPrice(userStockSubscribe.getBuyPrice()); |
| | |
| | | userPosition.setNewId(stockSubscribe.getNewlistId()); |
| | | int ret = 0; |
| | | ret = this.userPositionMapper.insert(userPosition); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", userPosition.getUserId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("US", userPosition.getUserId()); |
| | | if(null == userAssets){ |
| | | return ServerResponse.createByErrorMsg("新股转持仓失败"); |
| | | } |
| | | userAssetsMapper.updateById(userAssets); |
| | | iUserAssetsServices.availablebalanceChange("IN", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", ""); |
| | | iUserAssetsServices.availablebalanceChange("US", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", ""); |
| | | if (ret > 0) { |
| | | userStockSubscribe.setStatus(5); |
| | | userStockSubscribeMapper.update1(userStockSubscribe); |
| | |
| | | if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) { |
| | | return ServerResponse.createByErrorMsg("Order failed, account has been locked"); |
| | | } |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN", user.getId()); |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("US", user.getId()); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("请先缴清待补资金", request); |
| | | } |
| | |
| | | UserPosition userPosition = getUserPosition(dzId,num, user, stockDz, nowPrice, stock, buyAmt); |
| | | userPositionMapper.insert(userPosition); |
| | | BigDecimal buy_fee_amt = siteSettingBuyFee.multiply(buyAmt); |
| | | userAssetsServices.availablebalanceChange(EStockType.IN.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"",""); |
| | | iUserAssetsServices.availablebalanceChange("IN", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", ""); |
| | | userAssetsServices.availablebalanceChange(EStockType.US.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"",""); |
| | | iUserAssetsServices.availablebalanceChange("US", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", ""); |
| | | return ServerResponse.createBySuccess("购买成功", request); |
| | | } |
| | | |
| | |
| | | for (UserPosition position : list) { |
| | | UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>() |
| | | .eq(UserAssets::getUserId, position.getUserId()) |
| | | .eq(UserAssets::getAccectType, "IN") |
| | | .eq(UserAssets::getAccectType, "US") |
| | | ); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | continue; |
| | |
| | | |
| | | for (int i = 0; i <userRecharges.size() ; i++) { |
| | | SitePay s = sitePayMapper.selectById(userRecharges.get(i).getPayId()); |
| | | userRecharges.get(i).setAssetsType(EStockType.IN.getSymbol1()); |
| | | userRecharges.get(i).setChannelName(EStockType.IN.getSymbol()); |
| | | userRecharges.get(i).setAssetsType(EStockType.US.getSymbol1()); |
| | | userRecharges.get(i).setChannelName(EStockType.US.getSymbol()); |
| | | } |
| | | |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | |
| | | if (user.getIsLogin().intValue() == 1) { |
| | | return ServerResponse.createByErrorMsg("登录失败。账户锁定",request); |
| | | } |
| | | userAssetsServices.assetsByTypeAndUserId(EStockType.IN.getCode(),user.getId()); |
| | | userAssetsServices.assetsByTypeAndUserId(EStockType.US.getCode(),user.getId()); |
| | | this.iSiteLoginLogService.saveLog(user, request); |
| | | return ServerResponse.createBySuccess(user); |
| | | } |
| | |
| | | userPositions = userPositionMapper. |
| | | findMyPositionByCodeAndSpell(userId, |
| | | "","", |
| | | 0, "IN"); |
| | | 0, "US"); |
| | | |
| | | |
| | | List<UserPositionVO> userPositionVOS = Lists.newArrayList(); |
| | |
| | | ServerResponse money = iUserService.getMoney(user.getId()); |
| | | List<RUserAssets> rUserAssetsList = (List<RUserAssets>) money.getData(); |
| | | RUserAssets rUserAssets = rUserAssetsList.stream() |
| | | .filter(stock -> "IN".equals(stock.getAccectType())) |
| | | .filter(stock -> "US".equals(stock.getAccectType())) |
| | | .findFirst() |
| | | .orElse(null); |
| | | |
| | |
| | | |
| | | int insertCount = this.userMapper.insert(user); |
| | | dbUser = userMapper.selectOne(queryWrapper); |
| | | userAssetsServices.getAvailableBalance(EStockType.IN.getCode(),dbUser.getId() ); |
| | | userAssetsServices.availablebalanceChange(EStockType.IN.getCode(),dbUser.getId(),EUserAssets.TOP_UP,new BigDecimal(amt),"",""); |
| | | userAssetsServices.getAvailableBalance(EStockType.US.getCode(),dbUser.getId() ); |
| | | userAssetsServices.availablebalanceChange(EStockType.US.getCode(),dbUser.getId(),EUserAssets.TOP_UP,new BigDecimal(amt),"",""); |
| | | if (insertCount > 0) { |
| | | return ServerResponse.createBySuccessMsg("Success"); |
| | | } |
| | |
| | | ServerResponse money = iUserService.getMoney(user.getId()); |
| | | List<RUserAssets> rUserAssetsList = (List<RUserAssets>) money.getData(); |
| | | RUserAssets rUserAssets = rUserAssetsList.stream() |
| | | .filter(stock -> "IN".equals(stock.getAccectType())) |
| | | .filter(stock -> "US".equals(stock.getAccectType())) |
| | | .findFirst() |
| | | .orElse(null); |
| | | |
| | |
| | | } |
| | | User user = iUserService.getCurrentRefreshUser(request); |
| | | synchronized (user.getId()){ |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN",user.getId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("US",user.getId()); |
| | | if (model.getNewCode() != null) { |
| | | StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new QueryWrapper<StockSubscribe>() |
| | | .eq("newlist_id", model.getNewlistId())); |
| | |
| | | // bound = new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice()); |
| | | // } |
| | | // |
| | | BigDecimal useEnaAmount = iUserAssetsServices.getAvailableBalance(EStockType.IN.getCode(), user.getId()); |
| | | BigDecimal useEnaAmount = iUserAssetsServices.getAvailableBalance(EStockType.US.getCode(), user.getId()); |
| | | if(useEnaAmount.compareTo(bound)<0){ |
| | | return ServerResponse.createByErrorMsg("余额不足,配售失败",request); |
| | | } |
| | |
| | | UserStockSubscribe userStockSubscribe = Convert.convert(UserStockSubscribe.class, model); |
| | | userStockSubscribe.setNewStockId(stockSubscribe.getNewlistId()); |
| | | ret = userStockSubscribeMapper.insert(userStockSubscribe); |
| | | iUserAssetsServices.availablebalanceChange(EStockType.IN.getCode(), user.getId(),EUserAssets.BUY,bound.negate(),"",""); |
| | | iUserAssetsServices.availablebalanceChange(EStockType.US.getCode(), user.getId(),EUserAssets.BUY,bound.negate(),"",""); |
| | | if (ret > 0) { |
| | | return ServerResponse.createBySuccessMsg("配售成功",request); |
| | | } else { |
| | |
| | | } |
| | | |
| | | //客户中签直接扣除客户账户可用资金 |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", userStockSubscribe.getUserId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("US", userStockSubscribe.getUserId()); |
| | | if (model.getStatus() == 3 && model.getApplyNumber() != null){ |
| | | if(stockSubscribe.getType() == 1){ |
| | | model.setBond((stockSubscribe.getMinPrice() != null ? stockSubscribe.getMinPrice() : stockSubscribe.getPrice()).multiply(BigDecimal.valueOf(model.getApplyNumber()))); |
| | |
| | | } |
| | | BigDecimal cCount = new BigDecimal(model.getApplyNums()-model.getApplyNumber()); |
| | | BigDecimal tMoney = ((stockSubscribe.getMinPrice() != null ? stockSubscribe.getMinPrice() : stockSubscribe.getPrice())).multiply(cCount); |
| | | iUserAssetsServices.availablebalanceChange(EStockType.IN.getCode(),userStockSubscribe.getUserId(), |
| | | iUserAssetsServices.availablebalanceChange(EStockType.US.getCode(),userStockSubscribe.getUserId(), |
| | | EUserAssets.TOP_UP,tMoney,"",""); |
| | | model.setBond((stockSubscribe.getMinPrice() != null ? stockSubscribe.getMinPrice() : stockSubscribe.getPrice()).multiply(BigDecimal.valueOf(model.getApplyNumber()))); |
| | | model.setDbMoney(BigDecimal.ZERO); |
| | |
| | | userStockSubscribe.setSubmitTime(DateTimeUtil.getCurrentDate()); |
| | | userStockSubscribe.setStatus(4); |
| | | BigDecimal bigDecimal = iUserAssetsServices. |
| | | getAvailableBalance(EStockType.IN.getCode(), |
| | | getAvailableBalance(EStockType.US.getCode(), |
| | | userStockSubscribe.getUserId()); |
| | | |
| | | BigDecimal multiply = userStockSubscribe.getBuyPrice().multiply(new BigDecimal(userStockSubscribe.getApplyNumber())); |
| | | if(bigDecimal.compareTo(multiply) <= 0){ |
| | | return ServerResponse.createByErrorMsg("余额不足",request); |
| | | } |
| | | iUserAssetsServices.availablebalanceChange(EStockType.IN.getCode(),userStockSubscribe.getUserId(), |
| | | iUserAssetsServices.availablebalanceChange(EStockType.US.getCode(),userStockSubscribe.getUserId(), |
| | | EUserAssets.BUY,multiply.negate(),"",""); |
| | | userStockSubscribe.setDbMoney(BigDecimal.ZERO); |
| | | userStockSubscribeMapper.update1(userStockSubscribe); |
| | |
| | | } |
| | | |
| | | private boolean getServerResponse() { |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type", "IN")); |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type", "US")); |
| | | if (stockTimeSetting == null) { |
| | | return false; |
| | | } |
| | |
| | | User user = this.userMapper.selectById(userWithdraw.getUserId()); |
| | | |
| | | |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", user.getId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("US", user.getId()); |
| | | if (userAssets == null) { |
| | | return ServerResponse.createByErrorMsg("用户资金账户不存在"); |
| | | } |
| | |
| | | if (user == null) { |
| | | return ServerResponse.createByErrorMsg("用户不存在"); |
| | | } |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", user.getId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("US", user.getId()); |
| | | if (userAssets == null) { |
| | | return ServerResponse.createByErrorMsg("用户资金账户不存在"); |
| | | } |
| | |
| | | List<UserStockSubscribe> userStockSubscribes = userStockSubscribeMapper.selectList(new LambdaQueryWrapper<UserStockSubscribe>() |
| | | .eq(UserStockSubscribe::getStatus, 3)); |
| | | userStockSubscribes.forEach(f->{ |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN",f.getUserId()); |
| | | UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("US",f.getUserId()); |
| | | if(null != userAssets && userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) == 0){ |
| | | f.setStatus(4); |
| | | userStockSubscribeMapper.updateById(f); |
| | |
| | | if (syncINStockDataLock.tryLock()) { |
| | | try { |
| | | syncINStockData.set(true); // 设置处理中标识为true |
| | | loadAllStock(EStockType.IN); |
| | | loadAllStock(EStockType.US); |
| | | } finally { |
| | | syncINStockDataLock.unlock(); |
| | | syncINStockData.set(false); // 设置处理中标识为false |
| | |
| | | |
| | | Map<String, WebSocketClient> retMap = new HashMap<>(2); |
| | | try { |
| | | WebsocketRunClient websocketRunClient = new WebsocketRunClient(new URI(PropertiesUtil.getProperty("JS_IN_WS_URL")),EStockType.IN); |
| | | WebsocketRunClient websocketRunClient = new WebsocketRunClient(new URI(PropertiesUtil.getProperty("JS_IN_WS_URL")),EStockType.US); |
| | | websocketRunClient.connect(); |
| | | websocketRunClient.setConnectionLostTimeout(0); |
| | | new Thread(() -> { |
| | |
| | | stockRealTimeBean.setPc(stringObjectMap.get("Chg").toString()); |
| | | stockRealTimeBean.setPcp(stringObjectMap.get("ChgPct").toString()+"%"); |
| | | stockRealTimeBean.setTime(stringObjectMap.get("Time").toString()); |
| | | RedisKeyUtil.setCacheRealTimeStock(EStockType.IN,stockRealTimeBean); |
| | | RedisKeyUtil.setCacheRealTimeStock(EStockType.US,stockRealTimeBean); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | | if(!stockRealTimeBean.getPcp().contains("-")){ |
| | |
| | | String json = objectMapper.writeValueAsString(stockRealTimeBean); |
| | | sendLoca(json); |
| | | StockRealTimeBean stockDetailBean = new Gson().fromJson(s, StockRealTimeBean.class); |
| | | RedisKeyUtil.setCacheRealTimeStock(EStockType.IN,stockDetailBean); |
| | | RedisKeyUtil.setCacheRealTimeStock(EStockType.US,stockDetailBean); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | JS_IN_WS_URL = ws://api-in-pro-ws.js-stock.top |
| | | JS_IN_KEY = xKChgi47AP1NMwMeYI3c |
| | | |
| | | US_HTTP_API = http://api-us.js-stock.top/ |
| | | US_WS_URL = ws://ws-us.js-stock.top |
| | | US_KEY = jZFrku4RGQjP87Hmq5tm |
| | | US_HTTP_API = http://api-us-v2.js-stock.top |
| | | US_WS_URL = ws://api-us-v2-ws.js-stock.top |
| | | US_KEY = 9uG4sxnsLsGG9e1RhJJE |
| | | |
| | | HK_HTTP_API = http://test.js-stock.top/ |
| | | HK_WS_URL = ws://test-ws.js-stock.top |