|
@@ -1,5 +1,6 @@
|
|
|
package com.steerinfo.dil.controller;
|
|
|
|
|
|
+import com.steerinfo.dil.feign.ESFeign;
|
|
|
import com.steerinfo.dil.service.ITmstruckWeightResultService;
|
|
|
|
|
|
import com.steerinfo.dil.util.BaseRESTfulController;
|
|
@@ -39,6 +40,9 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
|
|
|
@Autowired
|
|
|
ITmstruckWeightResultService tmstruckWeightResultService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ESFeign esFeign;
|
|
|
+
|
|
|
@Autowired
|
|
|
ColumnDataUtil columnDataUtil;
|
|
|
|
|
@@ -65,13 +69,36 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
|
|
|
Integer apiId,
|
|
|
Integer pageNum,
|
|
|
Integer pageSize,
|
|
|
- Integer orderType
|
|
|
+ Integer orderType,
|
|
|
+ String con
|
|
|
){
|
|
|
-
|
|
|
mapValue.put("orderTypee", orderType);
|
|
|
-
|
|
|
- //不分页筛选数据
|
|
|
- List<Map<String, Object>> allJiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
|
|
|
+ //框计算
|
|
|
+ if(con != null){
|
|
|
+ if(!"undefined".equals(con)){
|
|
|
+ String index="get_jimao_list";//设置要查询的索引名称
|
|
|
+ return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> allJiMaoResult = null;
|
|
|
+ //如果有条件查询则跳过初始化,和创建索引
|
|
|
+ if(mapValue.size() == 1){
|
|
|
+ //将查询结果存入索引中
|
|
|
+ allJiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ //添加索引
|
|
|
+ map.put("index","get_jimao_list");
|
|
|
+ //添加id
|
|
|
+ map.put("indexId","jiMaoId");
|
|
|
+ allJiMaoResult.add(map);
|
|
|
+ //新建索引
|
|
|
+ esFeign.insertIndex(allJiMaoResult);
|
|
|
+ //删除
|
|
|
+ allJiMaoResult.remove(allJiMaoResult.size()-1);
|
|
|
+ }
|
|
|
+ if(allJiMaoResult == null){
|
|
|
+ allJiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
|
|
|
+ }
|
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
|
//分页数据
|
|
|
List<Map<String, Object>> jiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
|
|
@@ -79,6 +106,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
|
|
|
return success(pageList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@ApiOperation(value="查询计皮实绩")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
|
|
@@ -92,16 +120,41 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
|
|
|
Integer apiId,
|
|
|
Integer pageNum,
|
|
|
Integer pageSize,
|
|
|
- Integer orderType
|
|
|
+ Integer orderType,String con
|
|
|
){
|
|
|
|
|
|
mapValue.put("orderTypee", orderType);
|
|
|
+ //框计算
|
|
|
+ if(con != null){
|
|
|
+ if(!"undefined".equals(con)){
|
|
|
+ String index="get_jipi_list";//设置要查询的索引名称
|
|
|
+ return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
|
|
|
+ }
|
|
|
+ }
|
|
|
//不分页筛选数据
|
|
|
- List<Map<String, Object>> allJiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
|
|
|
+ List<Map<String, Object>> allJiPiResult = null;
|
|
|
+ //如果有条件查询则跳过初始化,和创建索引
|
|
|
+ if(mapValue.size() == 1){
|
|
|
+ //将查询结果存入索引中
|
|
|
+ allJiPiResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ //添加索引
|
|
|
+ map.put("index","get_jipi_list");
|
|
|
+ //添加id
|
|
|
+ map.put("indexId","jiPiId");
|
|
|
+ allJiPiResult.add(map);
|
|
|
+ //新建索引
|
|
|
+ esFeign.insertIndex(allJiPiResult);
|
|
|
+ //删除
|
|
|
+ allJiPiResult.remove(allJiPiResult.size()-1);
|
|
|
+ }
|
|
|
+ if(allJiPiResult == null){
|
|
|
+ allJiPiResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue);
|
|
|
+ }
|
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
|
//分页数据
|
|
|
- List<Map<String, Object>> jiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
|
|
|
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiMaoResult,jiMaoResult);
|
|
|
+ List<Map<String, Object>> jiPiResult = tmstruckWeightResultService.getAllJiPiResult(mapValue);
|
|
|
+ PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiPiResult,jiPiResult);
|
|
|
return success(pageList);
|
|
|
}
|
|
|
|