Browse Source

fixed bugs in homepage

maqingyang 11 tháng trước cách đây
mục cha
commit
c31283eefd
1 tập tin đã thay đổi với 42 bổ sung0 xóa
  1. 42 0
      src/main/java/com/kexun/controller/BusinessController.java

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

@@ -27,6 +27,48 @@ public class BusinessController {
 
     @Autowired
     private CustomInfoService CustomInfoService;
+    @RequestMapping("getBusinessSize")
+    public Result getBusinessSize(@RequestBody String json) {
+        JSONObject req = JSON.parseObject(json);
+        int businessType = req.getIntValue("businessType");
+        List<BusinessInfo> list=null;
+        switch(businessType){
+            case 0:
+                list = BusinessService.queryBusinessList("'0'",null);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("0")) {
+                        businessInfo.setStatus("待解析");
+                    }
+                }
+                break;
+            case 1:
+                list = BusinessService.queryBusinessList("'1','2'",null);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("1")) {
+                        businessInfo.setStatus("解析完成");
+                    } else if (businessInfo.getStatus().equals("2")) {
+                        businessInfo.setStatus("白户");
+                    }
+                }
+                break;
+            case 2:
+                list = BusinessService.queryBusinessList("'3','4'",null);
+                for (BusinessInfo businessInfo : list) {
+                    if (businessInfo.getStatus().equals("3")) {
+                        businessInfo.setStatus("查询失败");
+                    } else if (businessInfo.getStatus().equals("4")) {
+                        businessInfo.setStatus("查询异常");
+                    }
+                }
+                break;
+
+        }
+        int businessSize= list.size();
+        JSONObject resJson = new JSONObject();
+        resJson.put("business_size", businessSize);
+        return Result.success("ok", resJson);
+    }
+
     @RequestMapping("businessList")
     public Result businessList(@RequestBody String json) {
         JSONObject req = JSON.parseObject(json);