|
@@ -3,9 +3,16 @@ package com.xjrsoft.module.liteflow.node;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
+import com.google.gson.JsonArray;
|
|
|
|
|
+import com.google.gson.JsonElement;
|
|
|
|
|
+import com.google.gson.JsonObject;
|
|
|
|
|
+import com.google.gson.JsonParser;
|
|
|
import com.xjrsoft.common.enums.ArchivesStatusEnum;
|
|
import com.xjrsoft.common.enums.ArchivesStatusEnum;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.WorkflowApproveType;
|
|
import com.xjrsoft.common.enums.WorkflowApproveType;
|
|
|
|
|
+import com.xjrsoft.module.hikvision.entity.HikvisionData;
|
|
|
|
|
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
|
|
|
+import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
import com.xjrsoft.module.student.entity.StudentDropOut;
|
|
import com.xjrsoft.module.student.entity.StudentDropOut;
|
|
|
import com.xjrsoft.module.student.mapper.StudentDropOutMapper;
|
|
import com.xjrsoft.module.student.mapper.StudentDropOutMapper;
|
|
@@ -21,9 +28,11 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.support.TransactionSynchronization;
|
|
import org.springframework.transaction.support.TransactionSynchronization;
|
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
|
|
|
|
|
|
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.Set;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -42,6 +51,9 @@ public class StudentDropOutNode extends NodeComponent {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private WorkflowRecordMapper workflowRecordMapper;
|
|
private WorkflowRecordMapper workflowRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private HikvisionDataMapper hikvisionDataMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void process() throws Exception {
|
|
public void process() throws Exception {
|
|
|
// 获取表单中数据编号
|
|
// 获取表单中数据编号
|
|
@@ -92,6 +104,40 @@ public class StudentDropOutNode extends NodeComponent {
|
|
|
);
|
|
);
|
|
|
schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2904.getCode());
|
|
schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2904.getCode());
|
|
|
studentSchoolRollService.updateById(schoolRoll);
|
|
studentSchoolRollService.updateById(schoolRoll);
|
|
|
|
|
+
|
|
|
|
|
+ //删除海康出入权限
|
|
|
|
|
+ String hikvisionId = hikvisionDataMapper.getStudentHikvisionId(studentDropOut.getClassId());
|
|
|
|
|
+ ApiUtil apiUtil = new ApiUtil();
|
|
|
|
|
+ String apiPath = "/api/pmas/v1/person/batch/delete";
|
|
|
|
|
+ JsonObject paramJson = new JsonObject();
|
|
|
|
|
+ JsonArray personIndexCodes = new JsonArray();
|
|
|
|
|
+ personIndexCodes.add(hikvisionId);
|
|
|
|
|
+ paramJson.add("personIndexCodes", personIndexCodes);
|
|
|
|
|
+ String doPost = apiUtil.doPost(apiPath, paramJson.toString(), null);
|
|
|
|
|
+
|
|
|
|
|
+ JsonParser parser = new JsonParser();
|
|
|
|
|
+ JsonObject resultJson = parser.parse(doPost).getAsJsonObject();
|
|
|
|
|
+ if(resultJson.get("code").getAsInt() == 0){
|
|
|
|
|
+ JsonArray success = resultJson.get("data").getAsJsonObject().get("success").getAsJsonArray();
|
|
|
|
|
+
|
|
|
|
|
+ Set<String> valuesSet = new HashSet<>();
|
|
|
|
|
+ String keyToExtract = "indexCode";
|
|
|
|
|
+ // 遍历 JSON 数组并提取指定键的值
|
|
|
|
|
+ for (JsonElement jsonElement : success) {
|
|
|
|
|
+ JsonObject jsonObject = jsonElement.getAsJsonObject();
|
|
|
|
|
+ if (jsonObject.has(keyToExtract)) {
|
|
|
|
|
+ String value = jsonObject.get(keyToExtract).getAsString();
|
|
|
|
|
+ valuesSet.add(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(valuesSet.contains(hikvisionId)){
|
|
|
|
|
+ hikvisionDataMapper.delete(
|
|
|
|
|
+ new QueryWrapper<HikvisionData>().lambda()
|
|
|
|
|
+ .eq(HikvisionData::getSourceId, studentDropOut.getClassId())
|
|
|
|
|
+ .eq(HikvisionData::getHikvisionId, hikvisionId)
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|