fanxp hace 2 meses
padre
commit
e36c4433be

+ 3 - 3
.drone.yml

@@ -18,7 +18,7 @@ steps:
     image: alpine/git:v2.45.2
     depends_on: [maven]
     commands:
-      - git clone https://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
+      - git clone http://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
 #    volumes:
 #      - name: skywalking-cache
 #        path: /root/skywalking-agent-java
@@ -85,7 +85,7 @@ steps:
     image: alpine/git:v2.45.2
     depends_on: [maven]
     commands:
-      - git clone https://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
+      - git clone http://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
 
   - name: build
     image: docker:20.10.7
@@ -144,7 +144,7 @@ steps:
     image: alpine/git:v2.45.2
     depends_on: [maven]
     commands:
-      - git clone https://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
+      - git clone http://git.yingcaibx.com/public/skywalking-agent-java.git /drone/src/skywalking-agent-java
 
   - name: push
     image: docker:20.10.7

+ 1 - 2
src/main/resources/application-dev.yml

@@ -32,8 +32,7 @@ spring:
 
   redis:
     database: 11
-    #    host: 10.150.10.136
-    host: 127.0.0.1
+    host: 10.150.10.136
     port: 6379
     password: 9mwar,BNq}oMa63cUd?R   # 密码(默认为空)
     timeout: 36000ms  # 连接超时时长(毫秒)

+ 11 - 0
src/test/java/com/xjrsoft/module/job/HikvisionBaseDataTaskTest.java

@@ -78,6 +78,17 @@ class HikvisionBaseDataTaskTest {
         }
     }
 
+    @Test
+    void syncStudentData() throws InterruptedException {
+        DataUtil dataUtil = new DataUtil();
+        String tableName = "base_student";
+        List<HikvisionData> studentList = hikvisionDataMapper.selectList(
+                new QueryWrapper<HikvisionData>().lambda().eq(HikvisionData::getTableName, tableName)
+        );
+        Map<String, String> stringStringMap = dataUtil.insertStudentOne(tableName, null, studentList, 1827234730185633794L);
+        System.out.println(JsonUtil.toJsonString(stringStringMap));
+    }
+
     @Test
     void selectOrg(){
         String apiPath = "/api/resource/v1/org/orgList";

+ 29 - 15
src/test/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNodeTest.java

@@ -39,8 +39,9 @@ class ImportStudentFaceNodeTest {
 
     @Autowired
     private FaceImportMapper faceImportMapper;
+
     @Test
-    void test(){
+    void test() {
         String sql = "SELECT t1.* FROM xjr_user t1\n" +
                 "WHERE t1.delete_mark = 0 \n" +
                 "AND t1.id IN (" +
@@ -57,7 +58,7 @@ class ImportStudentFaceNodeTest {
             sql = "SELECT * FROM stundent_face_process WHERE user_id = " + userId + " AND exam_status = 1 AND STATUS = 1 ORDER BY create_date DESC,modify_date DESC LIMIT 1";
             Map<String, Object> process = SqlRunnerAdapter.db().selectOne(sql);
 
-            if(process == null || process.isEmpty()){
+            if (process == null || process.isEmpty()) {
                 continue;
             }
 
@@ -65,7 +66,7 @@ class ImportStudentFaceNodeTest {
             String fileUrl = faceImportMapper.GetStudentHikvisionImgById(id);
             // 数据处理
             StundentFaceProcess dataObj = stundentFaceProcessService.getById(process.get("id").toString());
-            if(dataObj == null){
+            if (dataObj == null) {
                 continue;
             }
             String apiUrl = "/api/resource/v1/person/condition/personInfo";
@@ -73,27 +74,27 @@ class ImportStudentFaceNodeTest {
             paramsJson.addProperty("paramName", "personId");
             JsonArray array = new JsonArray();
             String hikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
-            if(hikvisionId == null){
+            if (hikvisionId == null) {
                 hikvisionId = dataObj.getUserId().toString();
             }
             array.add(hikvisionId);
             paramsJson.add("paramValue", array);
             String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
-            if(personInfoRes == null){
+            if (personInfoRes == null) {
                 continue;
             }
             JsonObject personInfoData = parser.parse(personInfoRes).getAsJsonObject();
             String faceId = null;
-            if("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())){
+            if ("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())) {
                 JsonObject dataJson = personInfoData.get("data").getAsJsonObject();
-                if(dataJson.get("total").getAsInt() > 0){
+                if (dataJson.get("total").getAsInt() > 0) {
                     JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
                             .getAsJsonObject().get("personPhoto").getAsJsonArray();
-                    if(personPhoto.size() == 0){
+                    if (personPhoto.size() == 0) {
                         dataObj.setStatus(1);
                         dataObj.setExamStatus(1);
                         String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
-                        if(StrUtil.isEmpty(studentHikvisionId)){
+                        if (StrUtil.isEmpty(studentHikvisionId)) {
                             studentHikvisionId = dataObj.getUserId().toString();
                         }
                         String result = FaceImportUtil.ImportStudentFace(studentHikvisionId, fileUrl);
@@ -108,7 +109,20 @@ class ImportStudentFaceNodeTest {
     }
 
     @Test
-    void test2(){
+    void getPersonInfo() {
+        ApiUtil apiUtil = new ApiUtil();
+        String apiUrl = "/api/resource/v1/person/condition/personInfo";
+        JsonObject paramsJson = new JsonObject();
+        paramsJson.addProperty("paramName", "personId");
+        JsonArray array = new JsonArray();
+        array.add("1827234730185633794");
+        paramsJson.add("paramValue", array);
+        String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
+        System.out.println(personInfoRes);
+    }
+
+    @Test
+    void test2() {
 
         String sql = "SELECT * FROM stundent_face_process WHERE id in (1802917291234996224, 1798295439057399810,1798295434271698945)";
         List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
@@ -121,7 +135,7 @@ class ImportStudentFaceNodeTest {
             // 数据处理
             StundentFaceProcess dataObj = stundentFaceProcessService.getById(process.get("id").toString());
 
-            if(dataObj == null){
+            if (dataObj == null) {
                 continue;
             }
 
@@ -130,7 +144,7 @@ class ImportStudentFaceNodeTest {
             paramsJson.addProperty("paramName", "personId");
             JsonArray array = new JsonArray();
             String hikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
-            if(hikvisionId == null){
+            if (hikvisionId == null) {
                 continue;
             }
             array.add(hikvisionId);
@@ -138,12 +152,12 @@ class ImportStudentFaceNodeTest {
             String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
             JsonObject personInfoData = parser.parse(personInfoRes).getAsJsonObject();
             String faceId = null;
-            if("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())){
+            if ("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())) {
                 JsonObject dataJson = personInfoData.get("data").getAsJsonObject();
-                if(dataJson.get("total").getAsInt() > 0){
+                if (dataJson.get("total").getAsInt() > 0) {
                     JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
                             .getAsJsonObject().get("personPhoto").getAsJsonArray();
-                    if(personPhoto.size() == 0){
+                    if (personPhoto.size() == 0) {
                         ids.add(id);
                     }
                 }