Commit 37c6f426 authored by chenhao's avatar chenhao

添加对于工作流任务不存在,返回为Null时的判断,解决app端任务统计之后数据查看报错的问题

parent 0f454d9e
...@@ -7,6 +7,7 @@ import com.google.common.base.Joiner; ...@@ -7,6 +7,7 @@ import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
...@@ -79,6 +80,8 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify; ...@@ -79,6 +80,8 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify;
import com.yeejoin.amos.patrol.exception.YeeException; import com.yeejoin.amos.patrol.exception.YeeException;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService; import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import com.yeejoin.amos.patrol.mqtt.WebMqttComponent; import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -107,6 +110,7 @@ import java.util.Map; ...@@ -107,6 +110,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct; import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
@Service("latentDangerService") @Service("latentDangerService")
...@@ -565,13 +569,17 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -565,13 +569,17 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
AgencyUserModel user, AgencyUserModel user,
String loginOrgCode, String loginOrgCode,
String deptId) { String deptId) {
JSONObject respBody; List<LatentDangerListVo> voList = Lists.newArrayList();
JSONObject respBody;
Date startDate = new Date(); Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) { if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType());
} else { } else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
} }
if(ObjectUtils.isEmpty(respBody)) {
return null;
}
Date endDate = new Date(); Date endDate = new Date();
logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime())); logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime()));
JSONArray taskJsonList = respBody.getJSONArray("data"); JSONArray taskJsonList = respBody.getJSONArray("data");
...@@ -604,7 +612,6 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -604,7 +612,6 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// map.put("permissions", permissions); // map.put("permissions", permissions);
// List<LatentDangerBo> list = latentDangerMapper.listByMap(map); // List<LatentDangerBo> list = latentDangerMapper.listByMap(map);
// Long count = 0L; // Long count = 0L;
List<LatentDangerListVo> voList = Lists.newArrayList();
Date date = new Date(); Date date = new Date();
if (!CollectionUtils.isEmpty(dangerList)) { if (!CollectionUtils.isEmpty(dangerList)) {
Set<String> userIds = Sets.newHashSet(); Set<String> userIds = Sets.newHashSet();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment