| | |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.MoneyLogMapper; |
| | | import com.nq.dao.UserAssetsMapper; |
| | | import com.nq.dao.UserOptionLogMapper; |
| | | import com.nq.enums.EStockType; |
| | | import com.nq.enums.EUserAssets; |
| | | import com.nq.pojo.MoneyLog; |
| | | import com.nq.pojo.UserAssets; |
| | | import com.nq.pojo.UserOptionLog; |
| | | import com.nq.service.IUserAssetsServices; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | UserWithdrawServiceImpl withdrawService; |
| | | |
| | | @Resource |
| | | UserOptionLogMapper userOptionLogMapper; |
| | | |
| | | @Override |
| | | public UserAssets assetsByTypeAndUserId(String accetType, Integer userId) { |
| | |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(bigAmt)); |
| | | } |
| | | if( userAssetsMapper.updateById(userAssets)>0){ |
| | | userOptionLogMapper.insert(UserOptionLog.builder() |
| | | .userId(userAssets.getUserId()) |
| | | .money(bigAmt) |
| | | .userAccectId(userAssets.getId()) |
| | | .createTime(new Date()) |
| | | .type(amt.contains("-")?0:1) |
| | | .build()); |
| | | return ServerResponse.createBySuccess(); |
| | | }else{ |
| | | return ServerResponse.createByErrorMsg("修改金额失败"); |