| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import cn.hutool.core.util.CreditCodeUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.*; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITAgentService; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | |
| | | private HttpUtils httpUtils; |
| | | @Autowired |
| | | private TokenUtils tokenUtils; |
| | | @Autowired |
| | | private ITRechargeRecordService tRechargeRecordService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | */ |
| | | @ApiOperation(value = "充值余额") |
| | | @RequestMapping(value = "/recharge-balance") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @ResponseBody |
| | | public Object rechargeBalance(Integer id, String money) { |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | tDriver.setBackgroundBalance(new BigDecimal(money).add(tDriver.getBackgroundBalance())); |
| | | tDriverService.updateById(tDriver); |
| | | |
| | | // 添加充值记录 |
| | | TRechargeRecord tRechargeRecord = new TRechargeRecord(); |
| | | tRechargeRecord.setType(UserTypeEnum.AGENT.getCode()); |
| | | tRechargeRecord.setUserId(id); |
| | | tRechargeRecord.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tRechargeRecord.setAmount(new BigDecimal(money)); |
| | | tRechargeRecord.setPayType(2); |
| | | tRechargeRecord.setPayTime(new Date()); |
| | | tRechargeRecord.setPayStatus(2); |
| | | tRechargeRecord.setCreateTime(new Date()); |
| | | tRechargeRecord.setAgentId(Objects.requireNonNull(ShiroKit.getUser()).getId()); |
| | | tRechargeRecordService.insert(tRechargeRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |