| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xcong.excoin.common.LoginUserUtils; |
| | | import com.xcong.excoin.common.response.Result; |
| | | import com.xcong.excoin.modules.otc.dto.HasPayDto; |
| | | import com.xcong.excoin.modules.otc.dto.OrderApealDto; |
| | | import com.xcong.excoin.modules.otc.dto.OrderListDto; |
| | | import com.xcong.excoin.modules.otc.dto.OtcOrderAddDto; |
| | | import com.xcong.excoin.modules.member.dao.MemberDao; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.otc.dao.OtcReturnMoneyDao; |
| | | import com.xcong.excoin.modules.otc.dto.*; |
| | | import com.xcong.excoin.modules.otc.service.OtcOrderService; |
| | | import com.xcong.excoin.modules.otc.vo.BuyOrderDetailVo; |
| | | import com.xcong.excoin.modules.otc.vo.OrderListVo; |
| | | import com.xcong.excoin.modules.otc.vo.SaleOrderDetailVo; |
| | | import com.xcong.excoin.modules.otc.vo.TeamVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | |
| | | public class OtcOrderController { |
| | | |
| | | private final OtcOrderService otcOrderService; |
| | | private final OtcReturnMoneyDao otcReturnMoneyDao; |
| | | |
| | | @ApiOperation(value = "我要购买") |
| | | @PostMapping(value = "/buy") |
| | |
| | | public Result orderApeal(@RequestBody OrderApealDto orderApealDto) { |
| | | return otcOrderService.orderApeal(orderApealDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取我的团队") |
| | | @PostMapping(value = "/findTeamList") |
| | | public Result teamList(@RequestBody TeamDto teamDto) { |
| | | Page<TeamVo> page = new Page<>(teamDto.getPageNum(), teamDto.getPageSize()); |
| | | |
| | | MemberEntity member = LoginUserUtils.getAppLoginUser(); |
| | | IPage<TeamVo> data = otcReturnMoneyDao.selectMyTeamAmountInPage(member.getInviteId(), member.getId(), page); |
| | | BigDecimal totalAmount = otcReturnMoneyDao.selectTotalAmount(member.getId()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("totalCnt", data.getTotal()); |
| | | result.put("totalAmount", totalAmount == null ? BigDecimal.ZERO : totalAmount.setScale(4, BigDecimal.ROUND_DOWN)); |
| | | result.put("result", data.getRecords()); |
| | | return Result.ok(result); |
| | | } |
| | | } |