|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.*;
|
|
|
+import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.util.NumberUtils;
|
|
|
import com.fdkankan.platform.agent.constant.AgentConstant;
|
|
|
import com.fdkankan.common.user.SSOUser;
|
|
@@ -26,6 +27,9 @@ import com.fdkankan.platform.user.service.IUserService;
|
|
|
import com.fdkankan.platform.user.vo.ResponseCamera;
|
|
|
import com.fdkankan.platform.user.vo.ResponseCameraSpace;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.scene.api.feign.SceneUserSceneClient;
|
|
|
+import com.fdkankan.scene.api.vo.SceneCnt;
|
|
|
+import com.fdkankan.scene.api.vo.SceneProDTO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
@@ -67,6 +71,8 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
private IGoodsService goodsService;
|
|
|
@Value("${upload.type}")
|
|
|
private String type;
|
|
|
+ @Autowired
|
|
|
+ private SceneUserSceneClient sceneUserSceneClient;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -106,7 +112,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<ResponseCamera> getPageByUser(RequestCamera param, Long userId) {
|
|
|
+ public Page<ResponseCamera> getPageByUser(RequestCamera param, Long userId) throws Exception{
|
|
|
Page<ResponseCamera> pageVo = cameraDetailService.getPageByUserAndType(param, userId);
|
|
|
if (param.getCameraType() == 4 || param.getCameraType() == 9 || param.getCameraType() == 10){
|
|
|
coverList(pageVo.getRecords());
|
|
@@ -114,7 +120,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
return pageVo;
|
|
|
}
|
|
|
|
|
|
- private void coverList(List<ResponseCamera> list){
|
|
|
+ private void coverList(List<ResponseCamera> list) throws Exception{
|
|
|
UserIncrement userIncrement = null;
|
|
|
|
|
|
for (ResponseCamera responseCamera : list) {
|
|
@@ -150,12 +156,20 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
responseCamera.setCooperationUserName(userEntity.getUserName());
|
|
|
}
|
|
|
}
|
|
|
-// todo
|
|
|
-// responseCamera.setSceneNum(sceneService.findSceneNumByCameraId(responseCamera.getId()));
|
|
|
-// sceneProEntity = sceneService.findLastSceneByCameraId(responseCamera.getId());
|
|
|
-// if(sceneProEntity != null){
|
|
|
-// responseCamera.setLastTime(sceneProEntity.getCreateTime());
|
|
|
-// }
|
|
|
+ ResultData<Integer> sceneNumResult = sceneUserSceneClient
|
|
|
+ .getSceneNumByCameraId(responseCamera.getId());
|
|
|
+ if(!sceneNumResult.getSuccess())
|
|
|
+ throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
|
|
|
+ responseCamera.setSceneNum(sceneNumResult.getData());
|
|
|
+
|
|
|
+ ResultData<SceneProDTO> SceneProResult = sceneUserSceneClient
|
|
|
+ .getLastSceneByCameraId(responseCamera.getId());
|
|
|
+ if(!SceneProResult.getSuccess())
|
|
|
+ throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
|
|
|
+ SceneProDTO sceneProDTO = SceneProResult.getData();
|
|
|
+ if(sceneProDTO != null){
|
|
|
+ responseCamera.setLastTime(sceneProDTO.getCreateTime());
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -176,6 +190,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
return convert(list);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public List<ResponseCamera> convert(List<CameraDetail> list) {
|
|
|
List<ResponseCamera> vos = new ArrayList<>();
|
|
|
if (list != null && list.size() > 0){
|