Commit 10966fa6 by huluobin

api

parent 2b302fa7
......@@ -114,18 +114,24 @@
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- omitted xml -->
<distributionManagement>
<repository>
<!--必须与 settings.xml 的 id 一致-->
<id>bailuntec-bailuntec-java-java</id>
<name>java</name>
<url>https://bailuntec-maven.pkg.coding.net/repository/bailuntec-java/java/</url>
</repository>
</distributionManagement>
</project>
......@@ -13,8 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@FeignClient(name = "bailuntec-cost-api", url = "http://api.fee.bailuntec.com/fee/api/cost/api")
@FeignClient(name = "bailuntec-cost-api", url = "http://api.fee.bailuntec.com/purchase/other/cost/api")
public interface CostApi {
......@@ -71,8 +70,6 @@ public interface CostApi {
@ApiOperation("获取费用系统列表")
@GetMapping({"/getCostList"})
CostResult<PageInfo<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate,
@RequestParam(name = "pageIndex") Integer pageIndex,
@RequestParam(name = "pageSize") Integer pageSize);
CostResult<List<CostDto>> getCostList(@RequestParam(name = "startDate") String startDate,
@RequestParam(name = "endDate") String endDate);
}
......@@ -10,6 +10,6 @@ import org.springframework.cloud.openfeign.FeignClient;
* @author robbendev
* @since 2020/10/12 9:32 上午
*/
@FeignClient(name = "bailuntec-cost-api", url = "")
@FeignClient(name = "bailuntec-cost-list-api", url = "")
public interface CostListApi {
}
......@@ -156,9 +156,19 @@
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
<!--spring boot自动配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -2,9 +2,12 @@ package com.blt.other.common.config;
import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* mybatis plus配置
*
......@@ -13,20 +16,20 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
/**
* mp分页配置
*
* @return
*/
@Bean
public PageHelper pageHelper() {
PageHelper pageHelper = new PageHelper();
Properties p = new Properties();
p.setProperty("offsetAsPageNum", "true");
p.setProperty("rowBoundsWithCount", "true");
p.setProperty("reasonable", "true");
pageHelper.setProperties(p);
return pageHelper;
}
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
// 开启 count 的 join 优化,只针对部分 left join
return paginationInterceptor;
return new PaginationInterceptor();
}
......
......@@ -8,8 +8,6 @@ import com.bailuntec.cost.api.dto.WageCostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.database.model.CostDomain;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -129,14 +127,10 @@ public class CostApiController implements CostApi {
@ApiOperation("根据最后更新时间查询费用单")
@Override
@GetMapping({"/getCostList"})
public CostResult<PageInfo<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate,
@RequestParam(name = "pageIndex") Integer pageIndex,
@RequestParam(name = "pageSize") Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize);
public CostResult<List<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate) {
List<CostDto> costDtoList = this.costApiService.getCostList(startDate, endDate);
PageInfo<CostDto> pageInfo = new PageInfo<>(costDtoList);
return CostResult.success(pageInfo);
return CostResult.success(costDtoList);
}
......
......@@ -4,7 +4,7 @@ git pull
# 拉取开发分支代码
git checkout cost-check-flow-master
#打包
mvn clean package -Dmaven.test.skip=true -Dmaven.compile.fork=true
mvn clean package -U -Dmaven.test.skip=true -Dmaven.compile.fork=true
# kill测试进程
# shellcheck disable=SC2009
ps -ef | grep cost-core | grep -v grep | grep prod | awk '{print $2}' | xargs kill -9
......
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