Your Name %!s(int64=3) %!d(string=hai) anos
pai
achega
7612a2d9c7

+ 26 - 26
src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java

@@ -165,35 +165,35 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
     public RESTfulResult getPurchaseIdByBatch(@RequestBody(required = false) Map<String,Object> mapValue,
                                                  Integer pageNum,
                                                  Integer pageSize,
-                                                 Integer apiId) {
-//        if (con != null) {
-//            if (!con.equals("undefined")) {
-//                String index="get_purchase_batch";//设置要查询的索引名称
-//                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
-//            }
-//        }
+                                                 Integer apiId,
+                                                 String  con) {
+        if (con != null) {
+            if (!con.equals("undefined")) {
+                String index="get_purchase_batch";//设置要查询的索引名称
+                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
+            }
+        }
         if (mapValue == null) {
             mapValue = new HashMap<>();
         }
-//        List<Map<String, Object>> truckRequirementList = null;
-//        if (mapValue.size() == 0) {
-//            //将查询结果存入索引中
-//            truckRequirementList =  amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);
-//            Map<String, Object> map1 = new HashMap<>();
-//            //添加索引
-//            map1.put("index","get_purchase_batch");
-//            //添加id
-//            map1.put("indexId","purchaseOrderId");
-//            truckRequirementList.add(map1);
-//            //新建索引
-//            esFeign.insertIndex(truckRequirementList);
-//            //删除
-//            truckRequirementList.remove(truckRequirementList.size()-1);
-//        }
-//        if (truckRequirementList == null) {
-//            truckRequirementList = amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);
-//        }
-        List<Map<String, Object>> truckRequirementList = amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);
+        List<Map<String, Object>> truckRequirementList = null;
+        if (mapValue.size() == 0) {
+            //将查询结果存入索引中
+            truckRequirementList =  amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);
+            Map<String, Object> map1 = new HashMap<>();
+            //添加索引
+            map1.put("index","get_purchase_batch");
+            //添加id
+            map1.put("indexId","purchaseOrderId");
+            truckRequirementList.add(map1);
+            //新建索引
+            esFeign.insertIndex(truckRequirementList);
+            //删除
+            truckRequirementList.remove(truckRequirementList.size()-1);
+        }
+        if (truckRequirementList == null) {
+            truckRequirementList = amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);
+        }
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = amstruckInwardRequirementService.getPurchaseIdByBatch(mapValue);