|
@@ -1,5 +1,7 @@
|
|
package com.steerinfo.dil.controller;
|
|
package com.steerinfo.dil.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.steerinfo.dil.feign.ESFeign;
|
|
import com.steerinfo.dil.model.AmsshipCargoTransferResult;
|
|
import com.steerinfo.dil.model.AmsshipCargoTransferResult;
|
|
import com.steerinfo.dil.model.AmsshipDeliveryAttorney;
|
|
import com.steerinfo.dil.model.AmsshipDeliveryAttorney;
|
|
import com.steerinfo.dil.model.OmsshipShipmentInstructions;
|
|
import com.steerinfo.dil.model.OmsshipShipmentInstructions;
|
|
@@ -16,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -41,6 +44,8 @@ public class AmsshipCargoTransferResultController extends BaseRESTfulController
|
|
IAmsshipCargoTransferResultService amsshipCargoTransferResultService;
|
|
IAmsshipCargoTransferResultService amsshipCargoTransferResultService;
|
|
@Autowired
|
|
@Autowired
|
|
ColumnDataUtil columnDataUtil;
|
|
ColumnDataUtil columnDataUtil;
|
|
|
|
+ @Autowired
|
|
|
|
+ ESFeign esFeign;
|
|
@ApiOperation(value="展示货权转移表", notes="分页查询")
|
|
@ApiOperation(value="展示货权转移表", notes="分页查询")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@@ -48,15 +53,45 @@ public class AmsshipCargoTransferResultController extends BaseRESTfulController
|
|
@ApiImplicitParam(name = "apiId", value = "66", required = false, dataType = "BigDecimal"),
|
|
@ApiImplicitParam(name = "apiId", value = "66", required = false, dataType = "BigDecimal"),
|
|
})
|
|
})
|
|
@PostMapping(value = "/getAmsshipCargoTranferResultList")
|
|
@PostMapping(value = "/getAmsshipCargoTranferResultList")
|
|
- public RESTfulResult getAmsshipCargoTranferResultList(@RequestBody(required = false) Map<String,Object> mapVal,
|
|
|
|
|
|
+ public RESTfulResult getAmsshipCargoTranferResultList(@RequestBody(required = false) Map<String,Object> mapValue,
|
|
Integer pageNum,
|
|
Integer pageNum,
|
|
Integer pageSize,
|
|
Integer pageSize,
|
|
- Integer apiId){
|
|
|
|
- List<Map<String,Object>> list = amsshipCargoTransferResultService.seletCargoTransfer(mapVal);
|
|
|
|
|
|
+ Integer apiId,
|
|
|
|
+ String con){
|
|
|
|
+ //框计算
|
|
|
|
+ if(con != null){
|
|
|
|
+ if(!"undefined".equals(con)){
|
|
|
|
+ //设置要查询的索引名称
|
|
|
|
+ String index="get_ship_cargo_list";
|
|
|
|
+ //获取查询结果
|
|
|
|
+ return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //初始化过滤
|
|
|
|
+ List<Map<String, Object>> listTotal = null;
|
|
|
|
+ //如果有条件查询则跳过初始化,和创建索引
|
|
|
|
+ if (mapValue.size() == 0) {
|
|
|
|
+ //将查询结果存入索引中
|
|
|
|
+ listTotal = amsshipCargoTransferResultService.seletCargoTransfer(null);
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ //添加索引
|
|
|
|
+ map.put("index", "get_ship_cargo_list");
|
|
|
|
+ //添加id
|
|
|
|
+ map.put("indexId", "cargoTransferResultId");
|
|
|
|
+ listTotal.add(map);
|
|
|
|
+ //新建索引
|
|
|
|
+ String s = JSON.toJSONString(listTotal);
|
|
|
|
+ esFeign.insertIndex(listTotal);
|
|
|
|
+ //删除
|
|
|
|
+ listTotal.remove(listTotal.size() - 1);
|
|
|
|
+ }
|
|
|
|
+ if (listTotal == null) {
|
|
|
|
+ listTotal = amsshipCargoTransferResultService.seletCargoTransfer(mapValue);
|
|
|
|
+ }
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
//分页查询数据
|
|
//分页查询数据
|
|
- List<Map<String, Object>> columnList = amsshipCargoTransferResultService.seletCargoTransfer(mapVal);
|
|
|
|
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
|
|
|
|
|
|
+ List<Map<String, Object>> columnList = amsshipCargoTransferResultService.seletCargoTransfer(mapValue);
|
|
|
|
+ PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
|
|
return success(data);
|
|
return success(data);
|
|
}
|
|
}
|
|
//新增
|
|
//新增
|