Helius
2021-05-20 1a199909dd51facb507db98f799a9bab07c81557
modify
5 files modified
21 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/otc/controller/OtcEntrustOrderController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/dao/OtcEntrustOrderDao.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/service/OtcEntrustOrderService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcEntrustOrderServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/vo/EntrustListInfoVo.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/controller/OtcEntrustOrderController.java
@@ -62,9 +62,9 @@
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = EntrustListInfoVo.class)
    })
    @GetMapping(value = "/findOwnEntrustOrderList")
    public Result findOwnEntrustOrderList() {
        return Result.ok(otcEntrustOrderService.findOwnEntrustOrder());
    @PostMapping(value = "/findOwnEntrustOrderList")
    public Result findOwnEntrustOrderList(@RequestBody EntrustOrderListDto orderListDto) {
        return Result.ok(otcEntrustOrderService.findOwnEntrustOrder(orderListDto));
    }
    @ApiOperation(value = "获取我的委托单详情")
src/main/java/com/xcong/excoin/modules/otc/dao/OtcEntrustOrderDao.java
@@ -18,5 +18,7 @@
    List<OtcEntrustOrder> selectEntrustOrderByOrderType(@Param("record") OtcEntrustOrder otcEntrustOrder);
    IPage<OtcEntrustOrder> selectOwnEntrustListInPage(@Param("record") OtcEntrustOrder otcEntrustOrder, Page<OtcEntrustOrder> page);
    int updateRemainAmount(@Param("id") Long id, @Param("amount") BigDecimal amount);
}
src/main/java/com/xcong/excoin/modules/otc/service/OtcEntrustOrderService.java
@@ -19,7 +19,7 @@
    IPage<EntrustListVo> findEntrustListInPage(EntrustOrderListDto dto);
    List<EntrustListInfoVo> findOwnEntrustOrder();
    List<EntrustListInfoVo> findOwnEntrustOrder(EntrustOrderListDto orderListDto);
    void cancelEntrustOrder(Long id);
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcEntrustOrderServiceImpl.java
@@ -142,14 +142,16 @@
    }
    @Override
    public List<EntrustListInfoVo> findOwnEntrustOrder() {
    public List<EntrustListInfoVo> findOwnEntrustOrder(EntrustOrderListDto orderListDto) {
        MemberEntity member = LoginUserUtils.getAppLoginUser();
        OtcEntrustOrder query = new OtcEntrustOrder();
        query.setStatus(3);
        query.setMemberId(member.getId());
        List<OtcEntrustOrder> otcEntrustOrders = this.baseMapper.selectEntrustOrderByOrderType(query);
        return OtcEntrustOrderMapper.INSTANCE.entrustToListInfoVoList(otcEntrustOrders);
        Page<OtcEntrustOrder> page = new Page<>(orderListDto.getPageNum(), orderListDto.getPageSize());
        IPage<OtcEntrustOrder> result = this.baseMapper.selectOwnEntrustListInPage(query, page);
        return OtcEntrustOrderMapper.INSTANCE.entrustToListInfoVoList(result.getRecords());
    }
    @Override
src/main/java/com/xcong/excoin/modules/otc/vo/EntrustListInfoVo.java
@@ -38,6 +38,9 @@
    @ApiModelProperty(value = "上/下线 1-上线 2-下线")
    private Integer status;
    @ApiModelProperty(value = "订单类型 B/购买 S/出售")
    private String orderType;
    public BigDecimal getUnitPrice() {
        return unitPrice.setScale(2, BigDecimal.ROUND_DOWN);
    }