| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.nq.dao.*; |
| | | import com.nq.enums.EConfigKey; |
| | | import com.nq.enums.EUserAssets; |
| | | import com.nq.pay.PayUtil; |
| | | import com.nq.pojo.*; |
| | |
| | | @Autowired |
| | | SiteSettingServiceImpl siteSettingService; |
| | | |
| | | @Autowired |
| | | IStockConfigServices iStockConfigServices; |
| | | |
| | | |
| | | @Transactional |
| | | public ServerResponse outMoney(String amt, String with_Pwd,String accsetType,HttpServletRequest request) throws Exception { |
| | |
| | | if ((new BigDecimal(amt)).compareTo(new BigDecimal(siteSetting.getWithMinAmt().intValue())) == -1) { |
| | | return ServerResponse.createByErrorMsg("Analog users cannot withdraw funds" + siteSetting.getWithMinAmt(),request); |
| | | } |
| | | int with_time_begin = siteSetting.getWithTimeBegin().intValue(); |
| | | int with_time_end = siteSetting.getWithTimeEnd().intValue(); |
| | | SiteProduct siteProduct = iSiteProductService.getProductSetting(); |
| | | if(siteProduct.getHolidayDisplay()){ |
| | | return ServerResponse.createByErrorMsg("周末或节假日不允许提款!",request); |
| | | } |
| | | if (!WithDrawUtils.checkIsWithTime(with_time_begin, with_time_end)) { |
| | | return ServerResponse.createByErrorMsg("撤销失败了。提现时间为" + with_time_begin + "点 - " + with_time_end + "点之间的",request); |
| | | |
| | | |
| | | String time = iStockConfigServices.queryByKey(EConfigKey.WITHDRAW_TIME_SETTING.getCode()).getCValue(); |
| | | |
| | | if (!WithDrawUtils.checkIsWithTime( Integer.parseInt(time.split("-")[0]), Integer.parseInt(time.split("-")[1]))) { |
| | | return ServerResponse.createByErrorMsg("撤销失败了。提现时间为" + time.split("-")[0] + "点 - " + time.split("-")[1] + "点之间的",request); |
| | | } |
| | | BigDecimal useAmt = iUserAssetsServices.getAvailableBalance(accsetType,user.getId()); |
| | | BigDecimal tAmt = new BigDecimal(amt); |