lyhzzz 7 tháng trước cách đây
mục cha
commit
effcc6b2e4

+ 9 - 1
src/main/java/com/fdkankan/manage/service/impl/RtkDeviceServiceImpl.java

@@ -232,12 +232,19 @@ public class RtkDeviceServiceImpl extends ServiceImpl<IRtkDeviceMapper, RtkDevic
                 continue;
             }
             rtkSnSet.add(rtkSn);
+            Integer cameraType = null;
             if(StringUtils.isNotBlank(cameraSn)){
                 Camera camera = cameraService.getBySnCode(cameraSn);
                 if(camera == null){
                     errorIndex.add(index -3);
                     continue;
                 }
+                CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
+                if(cameraDetail == null){
+                    errorIndex.add(index -3);
+                    continue;
+                }
+                cameraType = CameraUtils.getCameraType3(cameraDetail.getType());
                 RtkDevice rtkDevice2 = this.getByCameraSn(cameraSn);
                 if(rtkDevice2 !=null){
                     errorIndex.add(index -3);
@@ -250,7 +257,7 @@ public class RtkDeviceServiceImpl extends ServiceImpl<IRtkDeviceMapper, RtkDevic
                 cameraSnSet.add(cameraSn);
 
             }
-            RtkDeviceInParam param = new RtkDeviceInParam(cameraSn,rtkTypeEnum.getCode(),rtkSn,rtkSgSn);
+            RtkDeviceInParam param = new RtkDeviceInParam(cameraSn,cameraType,rtkTypeEnum.getCode(),rtkSn,rtkSgSn);
             params.add(param);
         }
         excelService.toExcelError(errorIndex);
@@ -267,6 +274,7 @@ public class RtkDeviceServiceImpl extends ServiceImpl<IRtkDeviceMapper, RtkDevic
             RtkDevice rtkDevice = new RtkDevice();
             rtkDevice.setRtkSnCode(param.getRtkSn());
             rtkDevice.setCameraSn(param.getCameraSn());
+            rtkDevice.setCameraType(param.getCameraType());
             rtkDevice.setSgRtkSn(param.getRtkSgSn());
             rtkDevice.setRtkType(param.getRtkType());
             rtkDevice.setCreateUserId(Long.valueOf( StpUtil.getLoginId().toString()));

+ 14 - 0
src/main/java/com/fdkankan/manage/util/CameraUtils.java

@@ -24,6 +24,20 @@ public class CameraUtils {
         }
         return type;
     }
+
+    public static  Integer getCameraType3(Integer type){
+        switch (type){
+            case 0 :
+            case 1 :
+            case 2 :
+            case 5 :
+                return 0;
+            case 9 :return 1;
+            case 10 :return 2;
+            case 11 :return 3;
+        }
+        return type;
+    }
     public static  String getCameraTypeStr(Integer type){
         switch (type){
             case 1 : return "四维看看";

+ 1 - 0
src/main/java/com/fdkankan/manage/vo/request/RtkDeviceInParam.java

@@ -7,6 +7,7 @@ import lombok.Data;
 @AllArgsConstructor
 public class RtkDeviceInParam {
     private String cameraSn ;
+    private Integer cameraType ;
     private Integer rtkType ;
     private String rtkSn ;
     private String rtkSgSn ;