You've already forked FrameTour-BE
jackson
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package com.ycwl.basic.service.task.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ycwl.basic.utils.JacksonUtil;
|
||||
import com.aliyuncs.facebody.model.v20191230.SearchFaceRequest;
|
||||
import com.ycwl.basic.biz.OrderBiz;
|
||||
import com.ycwl.basic.constant.FaceConstant;
|
||||
@@ -98,7 +97,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
IFaceBodyAdapter faceBodyAdapter;
|
||||
if (scenicConfig != null && scenicConfig.getFaceType() != null) {
|
||||
faceBodyAdapter = FaceBodyFactory.getAdapter(scenicConfig.getFaceType());
|
||||
faceBodyAdapter.loadConfig(JSONObject.parseObject(scenicConfig.getFaceConfigJson(), Map.class));
|
||||
faceBodyAdapter.loadConfig(JacksonUtil.parseObject(scenicConfig.getFaceConfigJson(), Map.class));
|
||||
} else {
|
||||
faceBodyAdapter = FaceBodyFactory.use();
|
||||
}
|
||||
@@ -202,7 +201,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
SearchFaceRespVo respVo = new SearchFaceRespVo();
|
||||
List<SearchFaceResultItem> records = response.getResult();
|
||||
respVo.setScore(response.getOriginalFaceScore());
|
||||
respVo.setSearchResultJson(JSON.toJSONString(records));
|
||||
respVo.setSearchResultJson(JacksonUtil.toJSONString(records));
|
||||
logEntity.setMatchRawRecord(records);
|
||||
if (records.isEmpty()) {
|
||||
return respVo;
|
||||
@@ -265,7 +264,7 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
record.setMatched(item.getScore() > _threshold);
|
||||
collect.add(record);
|
||||
}
|
||||
logEntity.setMatchLocalRecord(JSONObject.toJSONString(collect));
|
||||
logEntity.setMatchLocalRecord(JacksonUtil.toJSONString(collect));
|
||||
if (acceptFaceSampleIds.isEmpty()) {
|
||||
respVo.setFirstMatchRate(0f);
|
||||
respVo.setSampleListIds(Collections.emptyList());
|
||||
|
@@ -1,9 +1,7 @@
|
||||
package com.ycwl.basic.service.task.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ycwl.basic.utils.JacksonUtil;
|
||||
import com.ycwl.basic.biz.OrderBiz;
|
||||
import com.ycwl.basic.biz.TaskStatusBiz;
|
||||
import com.ycwl.basic.biz.TemplateBiz;
|
||||
@@ -259,7 +257,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||
taskReqQuery.setFaceId(faceId);
|
||||
taskReqQuery.setTemplateId(templateId);
|
||||
taskReqQuery.setTaskParams(JSON.toJSONString(sourcesMap));
|
||||
taskReqQuery.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
||||
List<TaskRespVO> list = taskMapper.list(taskReqQuery);
|
||||
|
||||
MemberVideoEntity memberVideoEntity = new MemberVideoEntity();
|
||||
@@ -298,7 +296,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
taskEntity.setWorkerId(null);
|
||||
taskEntity.setStatus(0);
|
||||
taskEntity.setTaskParams(JSON.toJSONString(sourcesMap));
|
||||
taskEntity.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
||||
taskMapper.add(taskEntity);
|
||||
memberVideoEntity.setTaskId(taskEntity.getId());
|
||||
} else {
|
||||
@@ -471,7 +469,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
TaskReqQuery taskReqQuery = new TaskReqQuery();
|
||||
taskReqQuery.setFaceId(faceId);
|
||||
taskReqQuery.setTemplateId(templateId);
|
||||
taskReqQuery.setTaskParams(JSON.toJSONString(sourcesMap));
|
||||
taskReqQuery.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
||||
List<TaskRespVO> list = taskMapper.list(taskReqQuery);
|
||||
|
||||
MemberVideoEntity memberVideoEntity = new MemberVideoEntity();
|
||||
@@ -510,7 +508,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
taskEntity.setWorkerId(null);
|
||||
taskEntity.setStatus(0);
|
||||
taskEntity.setTaskParams(JSON.toJSONString(sourcesMap));
|
||||
taskEntity.setTaskParams(JacksonUtil.toJSONString(sourcesMap));
|
||||
taskMapper.add(taskEntity);
|
||||
memberVideoEntity.setTaskId(taskEntity.getId());
|
||||
} else {
|
||||
@@ -650,7 +648,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
IStorageAdapter adapter;
|
||||
try {
|
||||
adapter = StorageFactory.get(worker.getStoreType());
|
||||
adapter.loadConfig(JSONObject.parseObject(worker.getStoreConfigJson(), Map.class));
|
||||
adapter.loadConfig(JacksonUtil.parseObject(worker.getStoreConfigJson(), Map.class));
|
||||
} catch (Exception e) {
|
||||
adapter = scenicService.getScenicStorageAdapter(task.getScenicId());
|
||||
}
|
||||
@@ -677,15 +675,19 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
return null;
|
||||
}
|
||||
Date shotTime = taskRespVO.getCreateTime();
|
||||
JSONObject paramJson = JSON.parseObject(taskRespVO.getTaskParams());
|
||||
Map<String, Object> paramJson = JacksonUtil.parseObject(taskRespVO.getTaskParams(), Map.class);
|
||||
if (paramJson != null) {
|
||||
Optional<String> any = paramJson.keySet().stream().filter(StringUtils::isNumeric).findAny();
|
||||
if (any.isPresent()) {
|
||||
JSONArray jsonArray = paramJson.getJSONArray(any.get());
|
||||
if (!jsonArray.isEmpty()) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> jsonArray = (List<Map<String, Object>>) paramJson.get(any.get());
|
||||
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||
Map<String, Object> jsonObject = jsonArray.get(0);
|
||||
if (jsonObject.containsKey("createTime")) {
|
||||
shotTime = new Date(jsonObject.getLong("createTime"));
|
||||
Object createTimeObj = jsonObject.get("createTime");
|
||||
if (createTimeObj instanceof Number) {
|
||||
shotTime = new Date(((Number) createTimeObj).longValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user