|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.entity.Model;
|
|
import com.fdkankan.fusion.entity.Model;
|
|
|
|
+import com.fdkankan.fusion.entity.TmDepartment;
|
|
import com.fdkankan.fusion.entity.TmUser;
|
|
import com.fdkankan.fusion.entity.TmUser;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.common.PageInfo;
|
|
import com.fdkankan.fusion.common.PageInfo;
|
|
@@ -21,9 +22,7 @@ import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -53,6 +52,8 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
|
|
ITmDepartmentService tmDepartmentService;
|
|
ITmDepartmentService tmDepartmentService;
|
|
@Autowired
|
|
@Autowired
|
|
ITmUserService tmUserService;
|
|
ITmUserService tmUserService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ITmCameraService tmCameraService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo pageList(CaseParam param,String userName) {
|
|
public PageInfo pageList(CaseParam param,String userName) {
|
|
@@ -138,6 +139,31 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
|
|
listAll.add(sceneVo);
|
|
listAll.add(sceneVo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Set<String> snList = listAll.stream().filter(entity ->StringUtils.isNotBlank(entity.getSnCode()))
|
|
|
|
+ .map(SceneVo::getSnCode).collect(Collectors.toSet());
|
|
|
|
+ HashMap<String, TmDepartment> mapBySnCodes = tmCameraService.getMapBySnCodes(snList);
|
|
|
|
+ for (SceneVo sceneVo : listAll) {
|
|
|
|
+ if(StringUtils.isNotBlank(sceneVo.getSnCode())){
|
|
|
|
+ TmDepartment tmDepartment = mapBySnCodes.get(sceneVo.getSnCode());
|
|
|
|
+ if(tmDepartment != null){
|
|
|
|
+ sceneVo.setDeptId(tmDepartment.getId());
|
|
|
|
+ sceneVo.setDeptName(tmDepartment.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Set<String> deptIdset = listAll.stream().filter(entity ->StringUtils.isNotBlank(entity.getDeptId())&& StringUtils.isBlank(entity.getDeptName()))
|
|
|
|
+ .map(SceneVo::getDeptId).collect(Collectors.toSet());
|
|
|
|
+ HashMap<String, TmDepartment> mapByDept = tmDepartmentService.getMapByDeptIds(deptIdset);
|
|
|
|
+ for (SceneVo sceneVo : listAll) {
|
|
|
|
+ if(StringUtils.isNotBlank(sceneVo.getDeptId())){
|
|
|
|
+ TmDepartment tmDepartment = mapByDept.get(sceneVo.getDeptId());
|
|
|
|
+ if(tmDepartment != null){
|
|
|
|
+ sceneVo.setDeptName(tmDepartment.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
return listAll;
|
|
return listAll;
|
|
}
|
|
}
|
|
|
|
|