1123
This commit is contained in:
@@ -14,6 +14,7 @@ import com.bashi.common.utils.MessageUtils;
|
||||
import com.bashi.common.utils.PageUtils;
|
||||
import com.bashi.common.utils.SecurityUtils;
|
||||
import com.bashi.dk.domain.Borrow;
|
||||
import com.bashi.dk.dto.admin.resp.BorrowAdminVO;
|
||||
import com.bashi.dk.dto.app.req.BorrowStartReq;
|
||||
import com.bashi.dk.dto.app.resp.BorrowInfo;
|
||||
import com.bashi.dk.dto.app.resp.LoanProcessResp;
|
||||
@@ -82,13 +83,18 @@ public class AppBorrowController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation(value = "分页查询贷款我的贷款")
|
||||
public TableDataInfo<Borrow> page(PageParams pageParams){
|
||||
public TableDataInfo<BorrowAdminVO> page(PageParams pageParams){
|
||||
Long customerId = SecurityUtils.getLoginUser().getCustomer().getId();
|
||||
LambdaQueryWrapper<Borrow> query = Wrappers.lambdaQuery(Borrow.class)
|
||||
.eq(Borrow::getCustomerId,customerId)
|
||||
.orderByDesc(Borrow::getCreateTime);
|
||||
IPage<Borrow> page = borrowService.page(Condition.getPage(pageParams), query);
|
||||
return PageUtils.buildDataInfo(page);
|
||||
TableDataInfo<BorrowAdminVO> info = PageUtils.buildDataInfo(page, BorrowAdminVO::new);
|
||||
List<BorrowAdminVO> rows = info.getRows();
|
||||
for (BorrowAdminVO row : rows) {
|
||||
row.setDefaultCoinUnit(homeSettingService.getHomeSetting().getDefaultCoinUnit());
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,14 @@ package com.bashi.dk.controller.app;
|
||||
|
||||
import com.bashi.common.core.domain.AjaxResult;
|
||||
import com.bashi.common.core.domain.entity.Customer;
|
||||
import com.bashi.common.utils.BeanContextUtils;
|
||||
import com.bashi.common.utils.BeanConvertUtil;
|
||||
import com.bashi.common.utils.SecurityUtils;
|
||||
import com.bashi.dk.domain.CustomerInfo;
|
||||
import com.bashi.dk.dto.admin.resp.CustomerAdminVO;
|
||||
import com.bashi.dk.service.CustomerInfoService;
|
||||
import com.bashi.dk.service.CustomerService;
|
||||
import com.bashi.dk.service.HomeSettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -20,13 +24,17 @@ public class AppCustomerController {
|
||||
private CustomerInfoService customerInfoService;
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
@Autowired
|
||||
private HomeSettingService homeSettingService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@ApiOperation(value = "客户信息")
|
||||
public AjaxResult<Customer> info(){
|
||||
Customer customer = SecurityUtils.getLoginUser().getCustomer();
|
||||
customer = customerService.getById(customer.getId());
|
||||
return AjaxResult.success(customer);
|
||||
CustomerAdminVO customerAdminVO = BeanConvertUtil.convertTo(customer, CustomerAdminVO::new);
|
||||
customerAdminVO.setDefaultCoinUnit(homeSettingService.getHomeSetting().getDefaultCoinUnit());
|
||||
return AjaxResult.success(customerAdminVO);
|
||||
}
|
||||
|
||||
@GetMapping("/card/info")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.bashi.dk.dto.admin.resp;
|
||||
|
||||
import com.bashi.dk.domain.Borrow;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BorrowAdminVO extends Borrow {
|
||||
private String defaultCoinUnit;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.bashi.dk.dto.admin.resp;
|
||||
|
||||
import com.bashi.common.core.domain.entity.Customer;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CustomerAdminVO extends Customer {
|
||||
private String defaultCoinUnit;
|
||||
}
|
||||
Reference in New Issue
Block a user