Commit 872e9812 by huluobin

getCostList feign Api update

parent fdffd86d
......@@ -6,7 +6,6 @@ import com.bailuntec.cost.api.dto.LogisticsCostDto;
import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -71,5 +70,7 @@ public interface CostApi {
@ApiOperation("获取费用系统列表")
@GetMapping({"/getCostList"})
CostResult<List<CostDto>> getCostList(@RequestParam(name = "startDate") String startDate,
@RequestParam(name = "endDate") String endDate);
@RequestParam(name = "endDate") String endDate,
@RequestParam(name = "pageNum") Integer pageNum,
@RequestParam(name = "pageSize") Integer pageSize);
}
......@@ -136,8 +136,10 @@ public class CostApiController implements CostApi {
@Override
@GetMapping({"/getCostList"})
public CostResult<List<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate) {
List<CostDto> costDtoList = this.costApiService.getCostList(startDate, endDate);
@RequestParam String endDate,
@RequestParam(name = "pageNum") Integer pageNum,
@RequestParam(name = "pageSize") Integer pageSize) {
List<CostDto> costDtoList = this.costApiService.getCostList(startDate, endDate, pageNum, pageSize);
return CostResult.success(costDtoList);
}
......
......@@ -6,7 +6,6 @@ import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto;
import com.blt.other.module.cost.model.CostDomain;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Date;
......@@ -101,5 +100,5 @@ public interface CostApiService {
* @param endDate 结束时间
* @return 费用单list
*/
List<CostDto> getCostList(String startDate, String endDate);
List<CostDto> getCostList(String startDate, String endDate, Integer pageNum, Integer pageSize);
}
......@@ -3,6 +3,8 @@ package com.blt.other.module.cost.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.bailuntec.cost.api.dto.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.common.config.property.CostUrlProperties;
import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.HttpUtil;
......@@ -363,10 +365,13 @@ public class CostApiServiceImpl implements CostApiService {
}
@Override
public List<CostDto> getCostList(String startDate, String endDate) {
return this.costDao.selectList(new LambdaQueryWrapper<CostDomain>()
public List<CostDto> getCostList(String startDate, String endDate, Integer pageNum, Integer pageSize) {
IPage<CostDomain> page = new Page<>(pageNum, pageSize);
return this.costDao.selectPage(page, new LambdaQueryWrapper<CostDomain>()
.ge(CostDomain::getLastModifyDate, startDate)
.le(CostDomain::getLastModifyDate, endDate))
.getRecords()
.stream()
.map(CostDomain::castToDto)
.collect(Collectors.toList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment