Browse Source

账户监测

LiFei 5 years atrás
parent
commit
8fcee8ffea

+ 46 - 0
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/autoMonitor/AuthMonitorController.java

@@ -120,4 +120,50 @@ public class AuthMonitorController {
             throw new JeecgBootException("操作失败");
         }
     }
+
+
+    /**
+     * 企业账户监测
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @GetMapping(value = "/statisticData")
+    public Result<IPage<Object>> statisticData(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                 HttpServletRequest req) {
+        Result<IPage<Object>> result = new Result<IPage<Object>>();
+        String accessToken = OauthTokenUtils.getDayAccessToken();
+        String requestUrl = OauthApi.statisticData;
+        Map<String, Object> parameters = new HashMap<>();
+        parameters.put("pageNo", pageNo);
+        parameters.put("pageSize", pageSize);
+        log.info("param============{}", JSONObject.toJSONString(parameters));
+        //数据加密
+        String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
+        JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
+        log.info("jsonObject===={}", jsonObject);
+        if (jsonObject != null) {
+            if (jsonObject.getBoolean("success")) {
+                log.info("企业账户自动监测信息===={}", jsonObject);
+                JSONObject jsonObject1=jsonObject.getJSONObject("result");
+                List<Object> list= (List<Object>) jsonObject1.get("records");
+                Page<Object> pageList=new Page<Object>();
+                pageList.setRecords(list);
+                pageList.setTotal(jsonObject1.getInteger("total"));
+                pageList.setCurrent(jsonObject1.getInteger("current"));
+                pageList.setSize(jsonObject1.getInteger("size"));
+                result.setSuccess(true);
+                result.setResult(pageList);
+                return result;
+            } else {
+                //抛出异常
+                throw new JeecgBootException("未查询到数据");
+            }
+        } else {
+            throw new JeecgBootException("操作失败");
+        }
+    }
+
 }

+ 3 - 0
happy-boot-module-settlement/src/main/java/org/jeecg/common/utils/OauthApi.java

@@ -93,4 +93,7 @@ public interface OauthApi {
     //企业合同监测
     public static final String companyContract = "/oauth/autoMonitor/companyContract";
 
+    //企业账户监测
+    public static final String statisticData = "/oauth/autoMonitor/statisticData";
+
 }