| | |
| | | UserRecharge userRecharge = this.userRechargeMapper.findUserRechargeByOrderSn(orderno); |
| | | if(userRecharge == null){ |
| | | System.out.println("============ 充值完成==============="); |
| | | iUserRechargeService.createOrder(Integer.valueOf(arr[0]), 1, aDouble.intValue(), orderno); |
| | | iUserRechargeService.createOrder(Integer.valueOf(arr[0]), 1, aDouble.intValue(), orderno, null); |
| | | jsonObj.put("reason", "success"); |
| | | } else { |
| | | System.out.println("============充值失败,已回调成功无需重复回调==============="); |
| | |
| | | UserRecharge userRecharge = this.userRechargeMapper.findUserRechargeByOrderSn(orderno); |
| | | if(userRecharge == null){ |
| | | System.out.println("============充值完成==============="); |
| | | iUserRechargeService.createOrder(Integer.valueOf(arr[0]), 1, aDouble.intValue(), orderno); |
| | | iUserRechargeService.createOrder(Integer.valueOf(arr[0]), 1, aDouble.intValue(), orderno, null); |
| | | } else { |
| | | System.out.println("============充值失败,已回调成功无需重复回调==============="); |
| | | } |
| | |
| | | public ServerResponse updateayChnnel( |
| | | @RequestParam("id") Integer id, |
| | | @RequestParam("amt") String amt, |
| | | @RequestParam("type") String type |
| | | @RequestParam("type") String type, |
| | | @RequestParam("accectType") String accectType |
| | | |
| | | ){ |
| | | return iUserAssetsServices.updateUserAssets(id,amt,type); |
| | | return iUserAssetsServices.updateUserAssets(id,amt,type, accectType); |
| | | } |
| | | |
| | | } |
| | |
| | | @RequestMapping({"createOrder.do"}) |
| | | @ResponseBody |
| | | public ServerResponse createOrder(@RequestParam(value = "userId", required = false) Integer userId, @RequestParam(value = "state", required = false) Integer state, @RequestParam(value = "amt", required = false) Integer amt, @RequestParam(value = "payChannel", required = false) String payChannel) { |
| | | return this.iUserRechargeService.createOrder(userId, state, amt, payChannel); |
| | | return this.iUserRechargeService.createOrder(userId, state, amt, payChannel, null); |
| | | } |
| | | |
| | | //删除资金管理 充值列表订单信息 |
| | |
| | | */ |
| | | void addUserAssetsListByUserId(Integer userId); |
| | | |
| | | ServerResponse updateUserAssets(Integer id, String amt,String type); |
| | | ServerResponse updateUserAssets(Integer id, String amt,String type, String accectType); |
| | | |
| | | |
| | | List<UserAssets> assetsByUserId(Integer userId); |
| | |
| | | |
| | | ServerResponse updateState(Integer paramInteger1, Integer paramInteger2) throws Exception; |
| | | |
| | | ServerResponse createOrder(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, String paramString); |
| | | ServerResponse createOrder(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, String paramString, String accectType); |
| | | |
| | | ServerResponse del(Integer paramInteger); |
| | | |
| | |
| | | .eq(UserAssets::getUserId, paymentRecharge.getUserId()) |
| | | .eq(UserAssets::getAccectType, EStockType.getDefault().getCode()) |
| | | ); |
| | | ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getOriAmount().toString(), "2"); |
| | | ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getOriAmount().toString(), "2", null); |
| | | if(serverResponse.getStatus() == 0){ |
| | | paymentRecharge.setStatus(2); |
| | | paymentRecharge.setAmount(new BigDecimal(vo.getOriAmount())); |
| | |
| | | .eq(UserAssets::getUserId, paymentRecharge.getUserId()) |
| | | .eq(UserAssets::getAccectType, EStockType.getDefault().getCode()) |
| | | ); |
| | | ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getAccount_fee().toString(), "2"); |
| | | ServerResponse serverResponse = iUserAssetsServices.updateUserAssets(userAssets.getId(), vo.getAccount_fee().toString(), "2", null); |
| | | if(serverResponse.getStatus() == 0){ |
| | | paymentRecharge.setStatus(2); |
| | | paymentRecharge.setAmount(new BigDecimal(vo.getAccount_fee())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse updateUserAssets(Integer id, String amt,String type) { |
| | | public ServerResponse updateUserAssets(Integer id, String amt,String type, String accectType) { |
| | | UserAssets userAssets = userAssetsMapper.selectById(id); |
| | | UserPosition userPosition = userPositionMapper.selectOne(new LambdaQueryWrapper<UserPosition>().gt(UserPosition::getAmountToBeCovered, BigDecimal.ZERO).eq(UserPosition::getUserId,userAssets.getUserId())); |
| | | // 0 入款 1是扣钱 2 是充值 3 是提币 |
| | |
| | | } |
| | | }else{ |
| | | if(type.equals("2")){ |
| | | return userRechargeService.createOrder(userAssets.getUserId(),1,bigAmt.intValue(),"1"); |
| | | return userRechargeService.createOrder(userAssets.getUserId(),1,bigAmt.intValue(),"1", accectType); |
| | | }else{ |
| | | return ServerResponse.createBySuccess(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public ServerResponse createOrder(Integer userId, Integer state, Integer amt, String payChannel) { |
| | | public ServerResponse createOrder(Integer userId, Integer state, Integer amt, String payChannel, String accectType) { |
| | | if (userId == null || state == null || amt == null) { |
| | | return ServerResponse.createByErrorMsg("参数不能为空"); |
| | | } |
| | | |
| | | if (accectType == null || accectType.isEmpty()) { |
| | | accectType = EStockType.getDefault().getCode(); |
| | | } |
| | | try { |
| | | User user = this.userMapper.selectById(userId); |
| | | if (user == null) { |
| | |
| | | userRecharge.setPayTime(new Date()); |
| | | userRecharge.setOrderStatus(Integer.valueOf(1)); |
| | | userRecharge.setPayId(1); |
| | | userAssetsServices.availablebalanceChange(EStockType.getDefault().getCode(), |
| | | userAssetsServices.availablebalanceChange(accectType, |
| | | userId,EUserAssets.TOP_UP,new BigDecimal(amt),"",""); |
| | | int insertCount = this.userRechargeMapper.insert(userRecharge); |
| | | if (insertCount > 0) { |