| | |
| | | } |
| | | SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting(); |
| | | if ((new BigDecimal(amt)).compareTo(new BigDecimal(siteSetting.getWithMinAmt().intValue())) == -1) { |
| | | return ServerResponse.createByErrorMsg("Analog users cannot withdraw funds" + siteSetting.getWithMinAmt(),request); |
| | | return ServerResponse.createByErrorMsg("最小提现金额:" + siteSetting.getWithMinAmt(),request); |
| | | } |
| | | |
| | | boolean b = getServerResponse(); |
| | |
| | | } |
| | | |
| | | private boolean getServerResponse() { |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type","IN")); |
| | | if(stockTimeSetting == null){ |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type", "IN")); |
| | | if (stockTimeSetting == null) { |
| | | return false; |
| | | } |
| | | if(!stockTimeSetting.getWeekDay().contains(String.valueOf(LocalDate.now().getDayOfWeek().getValue()))){ |
| | | if (!stockTimeSetting.getWeekDay().contains(String.valueOf(LocalDate.now().getDayOfWeek().getValue()))) { |
| | | return false; |
| | | } |
| | | return TimeUtil.isTradingHour(stockTimeSetting.getAmStartTime(), stockTimeSetting.getAmEndTime(), stockTimeSetting.getPmStartTime(), stockTimeSetting.getPmEndTime()); |
| | |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | | public ServerResponse updateState(Integer withId, Integer state, String authMsg) throws Exception { |
| | | UserWithdraw userWithdraw = this.userWithdrawMapper.selectByPrimaryKey(withId); |
| | | SiteSetting siteSetting = siteSettingService.getSiteSetting(); |
| | |
| | | BigDecimal subtract = userWithdraw.getWithAmt().subtract(userAssets.getAmountToBeCovered()); |
| | | if(subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(subtract)); |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(userAssets.getAmountToBeCovered())); |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().subtract(subtract)); |
| | | userAssets.setAmountToBeCovered(BigDecimal.ZERO); |
| | | }else{ |
| | | userAssets.setAmountToBeCovered(userAssets.getAmountToBeCovered().subtract(userWithdraw.getWithAmt())); |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(userWithdraw.getWithAmt())); |
| | | } |
| | | }else{ |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(userWithdraw.getWithAmt())); |