maqingyang 11 сар өмнө
parent
commit
d050b93101

+ 45 - 0
src/main/java/com/kexun/controller/BusinessController.java

@@ -85,6 +85,7 @@ public class BusinessController {
         JSONObject req = JSON.parseObject(json);
         int pageNum = req.getIntValue("pageNum");
         int pageSize = req.getIntValue("pageSize");
+
         PageHelper.startPage(pageNum, pageSize);//设置分页信息
 
         List<BusinessInfo> list = BusinessService.queryToDoList();
@@ -98,7 +99,51 @@ public class BusinessController {
         resJson.put("business_todo_list", pageInfo);
         return Result.success("ok", resJson);
     }
+    @RequestMapping("selectBusiness")
+    public Result selectBusiness(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int pageNum = req.getIntValue("pageNum");
+        int pageSize = req.getIntValue("pageSize");
+        String customerName = req.getString("customerName");
+        int businessType = req.getIntValue("businessType");
+        PageHelper.startPage(pageNum, pageSize);//设置分页信息
+        List<BusinessInfo> list=null;
+        switch(businessType){
+            case 0:
+                list = BusinessService.selectBusinessToDo(customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("0")) {
+                        businessInfo.setStatus("待解析");
+                    }
+                }
+                break;
+            case 1:
+                list = BusinessService.selectBusinessAnalysis(customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("1")) {
+                        businessInfo.setStatus("解析完成");
+                    } else if (businessInfo.getStatus().equals("2")) {
+                        businessInfo.setStatus("白户");
+                    }
+                }
+                break;
+            case 2:
+                list = BusinessService.selectBusinessFail(customerName);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("3")) {
+                        businessInfo.setStatus("查询失败");
+                    } else if (businessInfo.getStatus().equals("4")) {
+                        businessInfo.setStatus("查询异常");
+                    }
+                }
+                break;
 
+        }
+        PageInfo pageInfo = new PageInfo(list);
+        JSONObject resJson = new JSONObject();
+        resJson.put("select_business_todo", pageInfo);
+        return Result.success("ok", resJson);
+    }
     /**
      * 待解析的业务
      *