|
@@ -8,6 +8,7 @@ import com.google.gson.JsonParser;
|
|
|
import com.xjrsoft.XjrSoftApplication;
|
|
import com.xjrsoft.XjrSoftApplication;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
import com.xjrsoft.common.utils.DatasourceUtil;
|
|
import com.xjrsoft.common.utils.DatasourceUtil;
|
|
|
|
|
+import com.xjrsoft.module.evaluate.controller.EvaluateItemController;
|
|
|
import com.xjrsoft.module.hikvision.entity.HikvisionData;
|
|
import com.xjrsoft.module.hikvision.entity.HikvisionData;
|
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
|
import com.xjrsoft.module.hikvision.util.DataUtil;
|
|
import com.xjrsoft.module.hikvision.util.DataUtil;
|
|
@@ -15,8 +16,10 @@ import com.xjrsoft.module.organization.entity.Department;
|
|
|
import com.xjrsoft.module.schedule.entity.JianyueData;
|
|
import com.xjrsoft.module.schedule.entity.JianyueData;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
|
|
import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
|
|
|
|
|
+import com.xjrsoft.module.hikvision.util.Teacher_Student_OutIn_RecordUtil;
|
|
|
import lombok.var;
|
|
import lombok.var;
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
+import org.junit.platform.commons.logging.LoggerFactory;
|
|
|
import org.junit.runner.RunWith;
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
@@ -30,6 +33,7 @@ import java.util.HashSet;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.logging.Logger;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author dzx
|
|
* @author dzx
|
|
@@ -41,6 +45,9 @@ class HikvisionBaseDataTaskTest {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FaceImportMapper faceImportMapper;
|
|
private FaceImportMapper faceImportMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ EvaluateItemController evaluateItemController;
|
|
|
|
|
+
|
|
|
@Test
|
|
@Test
|
|
|
void test() throws Exception {
|
|
void test() throws Exception {
|
|
|
DataSource datasource = DatasourceUtil.getDataSource(GlobalConstant.DEFAULT_DATASOURCE_KEY);
|
|
DataSource datasource = DatasourceUtil.getDataSource(GlobalConstant.DEFAULT_DATASOURCE_KEY);
|
|
@@ -65,17 +72,15 @@ class HikvisionBaseDataTaskTest {
|
|
|
dataMap.put(table, tableData);
|
|
dataMap.put(table, tableData);
|
|
|
}
|
|
}
|
|
|
DataUtil dataUtil = new DataUtil();
|
|
DataUtil dataUtil = new DataUtil();
|
|
|
-
|
|
|
|
|
-// deletePerson();
|
|
|
|
|
String tableName = "xjr_department";
|
|
String tableName = "xjr_department";
|
|
|
- Map<String, String> department = dataUtil.insertDepartment(use, tableName, dataMap.get(tableName));
|
|
|
|
|
- if(department.isEmpty() && dataMap.get(tableName) != null){
|
|
|
|
|
- department = dataMap.get(tableName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// Map<String, String> department = dataUtil.insertDepartment(use, tableName, dataMap.get(tableName));
|
|
|
|
|
+// if(department.isEmpty() && dataMap.get(tableName) != null){
|
|
|
|
|
+// department = dataMap.get(tableName);
|
|
|
|
|
+// }
|
|
|
//
|
|
//
|
|
|
- //推送教职工
|
|
|
|
|
- tableName = "base_teacher";
|
|
|
|
|
- dataUtil.insertTeacher(use, tableName, dataMap.get(tableName), department);
|
|
|
|
|
|
|
+// //推送教职工
|
|
|
|
|
+// tableName = "base_teacher";
|
|
|
|
|
+// dataUtil.insertTeacher(use, tableName, dataMap.get(tableName), department);
|
|
|
//
|
|
//
|
|
|
//推送车辆
|
|
//推送车辆
|
|
|
|
|
|
|
@@ -83,6 +88,7 @@ class HikvisionBaseDataTaskTest {
|
|
|
// Map<String, String> baseClass = dataMap.get(carTableName);
|
|
// Map<String, String> baseClass = dataMap.get(carTableName);
|
|
|
// dataUtil.insertCar(use, carTableName,baseClass, faceImportMapper);
|
|
// dataUtil.insertCar(use, carTableName,baseClass, faceImportMapper);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// tableName = "base_class";
|
|
// tableName = "base_class";
|
|
|
// Map<String, String> baseClass = dataMap.get(tableName);
|
|
// Map<String, String> baseClass = dataMap.get(tableName);
|
|
|
// Map<String, String> classes = dataUtil.insertClass(use, tableName, baseClass);
|
|
// Map<String, String> classes = dataUtil.insertClass(use, tableName, baseClass);
|
|
@@ -100,7 +106,7 @@ class HikvisionBaseDataTaskTest {
|
|
|
|
|
|
|
|
|
|
|
|
|
// selecAllPersonById(use);
|
|
// selecAllPersonById(use);
|
|
|
- selecAllPersonById(use);
|
|
|
|
|
|
|
+ selectResource(use);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void selectCar(Db db, String tableName) throws SQLException {
|
|
public static void selectCar(Db db, String tableName) throws SQLException {
|
|
@@ -248,30 +254,14 @@ class HikvisionBaseDataTaskTest {
|
|
|
|
|
|
|
|
void selecAllPersonById(Db db) throws SQLException {
|
|
void selecAllPersonById(Db db) throws SQLException {
|
|
|
String apiPath = "/api/resource/v2/person/advance/personList";
|
|
String apiPath = "/api/resource/v2/person/advance/personList";
|
|
|
|
|
+ JsonObject jsonObject = new JsonObject();
|
|
|
|
|
+ jsonObject.addProperty("pageNo", 1);
|
|
|
|
|
+ jsonObject.addProperty("pageSize", 500);
|
|
|
|
|
+ jsonObject.addProperty("personIds", "654321987655613");
|
|
|
|
|
|
|
|
|
|
|
|
|
- Map<Long, String> map = new HashMap<>();
|
|
|
|
|
- map.put(14954817043910L, "肖会春");map.put(14954817552454L, "苏平");map.put(14954818123205L, "刘瑞田");
|
|
|
|
|
- map.put(14954818337094L, "王开兰");map.put(14954818837189L, "龚仁容");map.put(14954819407814L, "张洪梅");
|
|
|
|
|
- map.put(14954819516102L, "袁夕芳");map.put(14954819746757L, "冯加林");map.put(14954820166213L, "张凤琴");
|
|
|
|
|
- map.put(14954820362949L, "周家慧");map.put(14954820552390L, "龙运刚");map.put(14954820751429L, "张怀会");
|
|
|
|
|
- map.put(14954825048006L, "李孝秋");map.put(14954802607430L, "王强");
|
|
|
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
|
- JsonParser parser = new JsonParser();
|
|
|
|
|
- Map<Long, String> idMap = new HashMap<>();
|
|
|
|
|
- for (Long id : map.keySet()) {
|
|
|
|
|
- JsonObject jsonObject = new JsonObject();
|
|
|
|
|
- jsonObject.addProperty("pageNo", 1);
|
|
|
|
|
- jsonObject.addProperty("pageSize", 500);
|
|
|
|
|
- jsonObject.addProperty("personName", map.get(id));
|
|
|
|
|
- String result = apiUtil.doPost(apiPath, jsonObject.toString(), null, null);
|
|
|
|
|
- JsonObject resultJson = parser.parse(result).getAsJsonObject();
|
|
|
|
|
- JsonObject info = resultJson.get("data").getAsJsonObject().get("list").getAsJsonArray().get(0).getAsJsonObject();
|
|
|
|
|
- String personId = info.get("personId").getAsString();
|
|
|
|
|
- idMap.put(id, personId);
|
|
|
|
|
- }
|
|
|
|
|
- insertRecord(db, "base_teacher",idMap);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String result = apiUtil.doPost(apiPath, jsonObject.toString(), null, null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void selecAllPerson(Db db) throws SQLException {
|
|
void selecAllPerson(Db db) throws SQLException {
|
|
@@ -347,24 +337,4 @@ class HikvisionBaseDataTaskTest {
|
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void deletePerson(){
|
|
|
|
|
- String apiPath = "/api/resource/v1/person/batch/delete";
|
|
|
|
|
- Map<Long, String> idMap = new HashMap<>();
|
|
|
|
|
- JsonParser jsonParser = new JsonParser();
|
|
|
|
|
- ApiUtil apiUtil = new ApiUtil();
|
|
|
|
|
- JsonArray dataArray = new JsonArray();
|
|
|
|
|
- dataArray.add("14954805813957");dataArray.add("14954812339909");dataArray.add("14954808977606");
|
|
|
|
|
- dataArray.add("14954812285254");dataArray.add("14954812392774");dataArray.add("14954812448325");
|
|
|
|
|
- dataArray.add("14954804711366");dataArray.add("15331003650245");dataArray.add("14954802607430");
|
|
|
|
|
- dataArray.add("14954807016389");dataArray.add("14954803353286");dataArray.add("14954806910277");
|
|
|
|
|
- dataArray.add("14954807016389");
|
|
|
|
|
-
|
|
|
|
|
- JsonObject paramJson = new JsonObject();
|
|
|
|
|
- paramJson.add("personIds", dataArray);
|
|
|
|
|
- Map<String, String> headerMap = new HashMap<>();
|
|
|
|
|
- headerMap.put("tagId", "deleteperson");
|
|
|
|
|
- String result = apiUtil.doPost(apiPath, paramJson.toString(), null, headerMap);
|
|
|
|
|
- System.out.println(result);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|