|
@@ -124,7 +124,6 @@ public class TBFaceController {
|
|
|
@PostMapping("pushTaskResult")
|
|
|
public Map<String, Object> pushTaskResult(HttpServletRequest request) {
|
|
|
try {
|
|
|
-
|
|
|
return faceTBService.pushTaskResult(getParam(request));
|
|
|
} catch (Exception e) {
|
|
|
log.info("上报任务结果处理 异常={}", e.getMessage());
|
|
@@ -134,19 +133,19 @@ public class TBFaceController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
-// @ApiOperation("批量上传人员")
|
|
|
-// @PostMapping("syncUsers")
|
|
|
-// public Map<String, Object> syncUsers(HttpServletRequest request) {
|
|
|
-// try {
|
|
|
-// return faceTBService.syncUsers(new HashMap<>());
|
|
|
-// } catch (Exception e) {
|
|
|
-// log.info("上报任务结果处理 异常={}", e.getMessage());
|
|
|
-// }
|
|
|
-// Map<String, Object> result = Maps.newHashMapWithExpectedSize(1);
|
|
|
-// result.put("errCode", "00");
|
|
|
-// return result;
|
|
|
-// }
|
|
|
+
|
|
|
+ @ApiOperation("批量上传人员")
|
|
|
+ @PostMapping("syncUsers")
|
|
|
+ public Map<String, Object> syncUsers(HttpServletRequest request) {
|
|
|
+ try {
|
|
|
+ return faceTBService.syncUsers(getParam(request));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("上报任务结果处理 异常={}", e.getMessage());
|
|
|
+ }
|
|
|
+ Map<String, Object> result = Maps.newHashMapWithExpectedSize(1);
|
|
|
+ result.put("errCode", "00");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation("获取任务ID")
|
|
|
@PostMapping("getTaskId")
|
|
@@ -163,48 +162,48 @@ public class TBFaceController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation("获取设备人员列表")
|
|
|
- @PostMapping("pushUsersOnline")
|
|
|
- public Map<String, Object> pushUsersOnline(HttpServletRequest request) {
|
|
|
-// List<Map<String, String>> list = new ArrayList<>();
|
|
|
-// try {
|
|
|
-// JSONObject paramJson = getParamJson(request);
|
|
|
-// JSONArray data = paramJson.getJSONArray("data");
|
|
|
-// for (Object datum : data) {
|
|
|
-// Map<String, String> map = new HashMap<>();
|
|
|
-// map.put(JSONObject.parseObject(datum.toString()).getString("cardid"), paramJson.getString("SN"));
|
|
|
-// map.put("SN", paramJson.getString("SN"));
|
|
|
-// map.put("taskId", paramJson.getString("taskId"));
|
|
|
-// list.add(map);
|
|
|
-// }
|
|
|
-// if (!list.isEmpty()){
|
|
|
-// faceTBService.pushUsersOnline(list);
|
|
|
+// @ApiOperation("获取设备人员列表")
|
|
|
+// @PostMapping("pushUsersOnline")
|
|
|
+// public Map<String, Object> pushUsersOnline(HttpServletRequest request) {
|
|
|
+//// List<Map<String, String>> list = new ArrayList<>();
|
|
|
+//// try {
|
|
|
+//// JSONObject paramJson = getParamJson(request);
|
|
|
+//// JSONArray data = paramJson.getJSONArray("data");
|
|
|
+//// for (Object datum : data) {
|
|
|
+//// Map<String, String> map = new HashMap<>();
|
|
|
+//// map.put(JSONObject.parseObject(datum.toString()).getString("cardid"), paramJson.getString("SN"));
|
|
|
+//// map.put("SN", paramJson.getString("SN"));
|
|
|
+//// map.put("taskId", paramJson.getString("taskId"));
|
|
|
+//// list.add(map);
|
|
|
+//// }
|
|
|
+//// if (!list.isEmpty()){
|
|
|
+//// faceTBService.pushUsersOnline(list);
|
|
|
+//// }
|
|
|
+//// } catch (Exception e) {
|
|
|
+//// log.info("推送刷脸刷卡记录 异常={}", e.getMessage());
|
|
|
+//// }
|
|
|
+// Map<String, Object> result = Maps.newHashMapWithExpectedSize(1);
|
|
|
+// result.put("errCode", "00");
|
|
|
+// return result;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+// private JSONObject getParamJson(HttpServletRequest request) {
|
|
|
+// StringBuilder sb = new StringBuilder();
|
|
|
+// try (InputStream is = request.getInputStream();
|
|
|
+// BufferedInputStream bis = new BufferedInputStream(is)) {
|
|
|
+// byte[] buffer = new byte[1024];
|
|
|
+// int read;
|
|
|
+// while ((read = bis.read(buffer)) != -1) {
|
|
|
+// sb.append(new String(buffer, 0, read, StandardCharsets.UTF_8));
|
|
|
// }
|
|
|
// } catch (Exception e) {
|
|
|
-// log.info("推送刷脸刷卡记录 异常={}", e.getMessage());
|
|
|
+// e.printStackTrace();
|
|
|
// }
|
|
|
- Map<String, Object> result = Maps.newHashMapWithExpectedSize(1);
|
|
|
- result.put("errCode", "00");
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private JSONObject getParamJson(HttpServletRequest request) {
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
- try (InputStream is = request.getInputStream();
|
|
|
- BufferedInputStream bis = new BufferedInputStream(is)) {
|
|
|
- byte[] buffer = new byte[1024];
|
|
|
- int read;
|
|
|
- while ((read = bis.read(buffer)) != -1) {
|
|
|
- sb.append(new String(buffer, 0, read, StandardCharsets.UTF_8));
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- String paramStr = sb.toString();
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(paramStr);
|
|
|
- return jsonObject;
|
|
|
- }
|
|
|
+// String paramStr = sb.toString();
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(paramStr);
|
|
|
+// return jsonObject;
|
|
|
+// }
|
|
|
|
|
|
|
|
|
private Map<String, Object> getParam(HttpServletRequest request) {
|