lyhzzz недель назад: 3
Родитель
Сommit
7d225c9bca
1 измененных файлов с 14 добавлено и 11 удалено
  1. 14 11
      src/main/java/com/fdkankan/fusion/service/impl/DownService.java

+ 14 - 11
src/main/java/com/fdkankan/fusion/service/impl/DownService.java

@@ -139,20 +139,23 @@ public class DownService implements IDownService {
     }
 
     private void saveLog(ScenePlus scenePlus,Integer sceneVersion,String type,Integer isObj){
-        String userName =  (String) StpUtil.getExtra("userName");
-        String nickName =  (String) StpUtil.getExtra("nickName");
-        String deptId = tmDepartmentService.getDeptId();
-        TmDepartment tmDepartment = tmDepartmentService.getById(deptId);
-        Camera camera = cameraService.getByCameraId(scenePlus.getCameraId());
         SceneDownLog sceneDownloadLogEntity = new SceneDownLog();
+        if(!"offline".equals(type)){
+            String userName =  (String) StpUtil.getExtra("userName");
+            String nickName =  (String) StpUtil.getExtra("nickName");
+            String deptId = tmDepartmentService.getDeptId();
+            TmDepartment tmDepartment = tmDepartmentService.getById(deptId);
+            Camera camera = cameraService.getByCameraId(scenePlus.getCameraId());
+            sceneDownloadLogEntity.setUserName(userName);
+            sceneDownloadLogEntity.setNickName(nickName);
+            sceneDownloadLogEntity.setSnCode(camera.getSnCode());
+            sceneDownloadLogEntity.setDeptName(tmDepartment.getName());
+            sceneDownloadLogEntity.setDeptLevel(tmDepartment.getDeptType());
+            sceneDownloadLogEntity.setDeptId(deptId);
+        }
+
         sceneDownloadLogEntity.setSceneNum(scenePlus.getNum());
         sceneDownloadLogEntity.setSceneTitle(scenePlus.getTitle());
-        sceneDownloadLogEntity.setUserName(userName);
-        sceneDownloadLogEntity.setNickName(nickName);
-        sceneDownloadLogEntity.setSnCode(camera.getSnCode());
-        sceneDownloadLogEntity.setDeptName(tmDepartment.getName());
-        sceneDownloadLogEntity.setDeptLevel(tmDepartment.getDeptType());
-        sceneDownloadLogEntity.setDeptId(deptId);
         sceneDownloadLogEntity.setStatus(0);
         sceneDownloadLogEntity.setVersion(sceneVersion);
         sceneDownloadLogEntity.setIsObj(isObj);