Commit 872e9812 by huluobin

getCostList feign Api update

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