|
@@ -1,6 +1,8 @@
|
|
|
package com.steerinfo.dil.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.steerinfo.dil.feign.ColumnDataFeign;
|
|
|
+import com.steerinfo.dil.feign.ESFeign;
|
|
|
import com.steerinfo.dil.model.TmsshipTotalResult;
|
|
|
import com.steerinfo.dil.service.ITmsshipTotalResultService;
|
|
|
import com.steerinfo.dil.service.impl.TmsshipTotalResultServiceImpl;
|
|
@@ -45,7 +47,8 @@ public class TmsshipTotalResultController extends BaseRESTfulController {
|
|
|
ColumnDataFeign columnDataFeign;
|
|
|
@Autowired
|
|
|
ColumnDataUtil columnDataUtil;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ ESFeign esFeign;
|
|
|
/**
|
|
|
* 展示水路货物运单列表
|
|
|
* @param mapVal
|
|
@@ -56,21 +59,52 @@ public class TmsshipTotalResultController extends BaseRESTfulController {
|
|
|
*/
|
|
|
@ApiOperation(value="展示水路货物运单", notes="分页查询")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "apiId", value = "56", required = false, dataType = "BigDecimal"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
|
|
|
+ @ApiImplicitParam(name = "apiId", value = "56", required = false, dataType = "BigDecimal"),
|
|
|
})
|
|
|
@PostMapping(value = "/listAllOrders")
|
|
|
public RESTfulResult listAllOrders(@RequestBody(required = false) Map<String,Object> mapVal,
|
|
|
Integer pageNum,
|
|
|
Integer pageSize,
|
|
|
- Integer apiId){
|
|
|
- List<Map<String,Object>> list = tmsshipTotalResultService.getOrderList(mapVal);
|
|
|
+ Integer apiId,
|
|
|
+ String con){
|
|
|
+ //框计算
|
|
|
+ if(con != null){
|
|
|
+ if(!"undefined".equals(con)){
|
|
|
+ //设置要查询的索引名称
|
|
|
+ String index="get_all_order_list";
|
|
|
+ //获取查询结果
|
|
|
+ return success(esFeign.getConResult(mapVal,index,apiId,pageNum,pageSize,con));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //初始化过滤
|
|
|
+ List<Map<String, Object>> detailListTotal = null;
|
|
|
+ //如果有条件查询则跳过初始化,和创建索引
|
|
|
+ if (mapVal == null) {
|
|
|
+ //将查询结果存入索引中
|
|
|
+ detailListTotal = tmsshipTotalResultService.getOrderList(null);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ //添加索引
|
|
|
+ map.put("index", "get_all_order_list");
|
|
|
+ //添加id
|
|
|
+ map.put("indexId", "resultId");
|
|
|
+ detailListTotal.add(map);
|
|
|
+ //新建索引
|
|
|
+ String s = JSON.toJSONString(detailListTotal);
|
|
|
+ esFeign.insertIndex(detailListTotal);
|
|
|
+ //删除
|
|
|
+ detailListTotal.remove(detailListTotal.size() - 1);
|
|
|
+ }
|
|
|
+ if (detailListTotal == null) {
|
|
|
+ detailListTotal = tmsshipTotalResultService.getOrderList(mapVal);
|
|
|
+ }
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
//分页查询数据
|
|
|
List<Map<String, Object>> columnList = tmsshipTotalResultService.getOrderList(mapVal);
|
|
|
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
|
|
|
+ PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
|
|
|
return success(data);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|