|
|
@@ -16,6 +16,7 @@ import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import lombok.var;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
@@ -582,19 +583,20 @@ public class DataUtil {
|
|
|
*/
|
|
|
public void deletePerson(List<Long> userIds){
|
|
|
String tableName = "hikvision_data";
|
|
|
- Entity where = Entity.create(tableName);
|
|
|
- where.set("source_id", userIds);
|
|
|
-
|
|
|
- List<Map<String, Object>> maps = SqlRunnerAdapter.db().dynamicSelect(tableName, where);
|
|
|
- if(maps.isEmpty()){
|
|
|
- return;
|
|
|
+ JsonArray personIds = new JsonArray();
|
|
|
+ for (Long userId : userIds) {
|
|
|
+ String sql = "select * from hikvision_data where source_id = '" + userId + "'";
|
|
|
+ List<Map<String, Object>> maps = SqlRunnerAdapter.db().selectList(sql);
|
|
|
+ if(maps.isEmpty()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (Map<String, Object> map : maps) {
|
|
|
+ personIds.add(map.get("hikvision_id").toString());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
String apiPath = "/api/resource/v1/person/batch/delete";
|
|
|
- JsonArray personIds = new JsonArray();
|
|
|
|
|
|
- for (Map<String, Object> map : maps) {
|
|
|
- personIds.add(map.get("hikvision_id").toString());
|
|
|
- }
|
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
|
|
|
|
JsonObject param = new JsonObject();
|