Commit 619a7bfe authored by 赵啸非's avatar 赵啸非

测试 事项查询

parent 0ee29257
......@@ -225,8 +225,7 @@ public class DemoWebApiController {
@UnAuth
public Rest<String> testAllMatterPage(@RequestBody SiteEntity siteEntity) {
StopWatch stopWatch = new StopWatch("stopwatch syncmatter");
log.info("开始查询事项==");
stopWatch.start("开始同步事项方法");
log.info("开始分页查询事项==");
MatterQuery matterQuery = new MatterQuery();
matterQuery.setAreaCode(siteEntity.getAreaCode());
matterQuery.setSource(SourceEnum.政务网.getValue());
......@@ -236,18 +235,21 @@ public class DemoWebApiController {
if (!ObjectUtils.isEmpty(matterQuery.getSource())) {
param.getCondition().put("source", matterQuery.getSource());
}
int count = matterService.getDao().getMatterListByAreaCodeCount(param);
log.info("本地事项总数:{}", count);
ArrayList<MatterEntity> allList = new ArrayList<>();
if (count > 0) {
//分页获取
int pages = count / 500+1;
for (int i = 1; i <= pages; i++) {
stopWatch.start("开始同步事项方法");
PageInfo pageInfo = new PageInfo();
pageInfo.setCurrPage(i);
pageInfo.setPrePageResult(500);
Result<MatterEntity> rest = matterService.getDao().getMatterListByAreaCodePage(matterQuery, pageInfo);
allList.addAll(rest.getList());
stopWatch.stop();
log.info("本地事项总数:{},{}s", allList.size(), stopWatch.getLastTaskTimeMillis() / 1000);
}
stopWatch.stop();
log.info("本地事项总数:{},{}s", allList.size(), stopWatch.getLastTaskTimeMillis() / 1000);
......@@ -259,6 +261,27 @@ public class DemoWebApiController {
}
@PostMapping(value = "testAllMatterCount")
@UnAuth
public Rest<String> testAllMatterCount(@RequestBody SiteEntity siteEntity) {
StopWatch stopWatch = new StopWatch("stopwatch syncmatter");
log.info("开始分页查询事项==");
MatterQuery matterQuery = new MatterQuery();
matterQuery.setAreaCode(siteEntity.getAreaCode());
matterQuery.setSource(SourceEnum.政务网.getValue());
ParamDto param = new ParamDto();
param.getCondition().put("areaCode", matterQuery.getAreaCode());
if (!ObjectUtils.isEmpty(matterQuery.getSource())) {
param.getCondition().put("source", matterQuery.getSource());
}
int count = matterService.getDao().getMatterListByAreaCodeCount(param);
log.info("本地事项总数:{}", count);
return Rest.ok();
}
public static void main(String[] args) {
System.out.println(1001/500);
......
......@@ -18,7 +18,7 @@
<property name="showSql" value="MySql" />
</plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="false" />
<property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" />
</plugin>
</plugins>
......
......@@ -104,6 +104,25 @@ Content-Type: application/json
}
###test testAllMatter
POST {{baseUrl}}/test/testAllMatter
Content-Type: application/json
{
"areaCode":"511500000000"
}
###test testAllMatterPage
POST {{baseUrl}}/test/testAllMatterPage
Content-Type: application/json
{
"areaCode":"511500000000"
}
###testre
POST {{baseUrl}}/test/reDepts
Content-Type: application/json
......
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