Przeglądaj źródła

Merge branch 'test'

lyhzzz 1 rok temu
rodzic
commit
8030cd8907

+ 17 - 20
src/main/java/com/fdkankan/manage/controller/RtkInfoController.java

@@ -43,29 +43,24 @@ public class RtkInfoController {
 
     @PostMapping("/saveOrEdit")
     public ResultData saveOrEdit(@RequestBody RtkInfo rtkInfo){
-        if(rtkInfo.getRtkType() == null || StringUtils.isBlank(rtkInfo.getCameraSnCode()) || StringUtils.isBlank(rtkInfo.getRtkSnCode())){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        if(StringUtils.isNotBlank(rtkInfo.getRtkSnCode())){
+            RtkInfo dbRtkInfo = rtkInfoService.getByRtkSnCode(rtkInfo.getRtkSnCode());
+            if(rtkInfo.getId() == null){
+                if(dbRtkInfo != null){
+                    throw new BusinessException(ResultCode.RTK_SN_EXIST);
+                }
+            }else {
+                if( dbRtkInfo != null && !Objects.equals(dbRtkInfo.getId(), rtkInfo.getId()) ){
+                    throw new BusinessException(ResultCode.RTK_SN_EXIST);
+                }
+            }
         }
-        RtkInfo dbRtkInfo = rtkInfoService.getByRtkSnCode(rtkInfo.getRtkSnCode());
-        RtkInfo dbRtkInfo2 = rtkInfoService.getByCameraSnCode(rtkInfo.getCameraSnCode());
         if(rtkInfo.getId() == null){
             rtkInfo.setCreateUserId(Long.valueOf((String)StpUtil.getLoginId()));
-            if(dbRtkInfo != null){
-                throw new BusinessException(ResultCode.RTK_SN_EXIST);
-            }
-            if(dbRtkInfo2 != null){
-                throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
-            }
         }else {
             rtkInfo.setUpdateUserId(Long.valueOf((String)StpUtil.getLoginId()));
-            if( dbRtkInfo != null && !Objects.equals(dbRtkInfo.getId(), rtkInfo.getId()) ){
-                throw new BusinessException(ResultCode.RTK_SN_EXIST);
-            }
-            if( dbRtkInfo2 != null && !Objects.equals(dbRtkInfo2.getId(), rtkInfo.getId()) ){
-                throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
-            }
         }
-        if(rtkInfo.getRtkType() == 0){
+        if(rtkInfo.getRtkType() != null && rtkInfo.getRtkType() == 0){
             rtkInfo.setIpAddr(null);
             rtkInfo.setMountPoint(null);
             rtkInfo.setPort(null);
@@ -73,9 +68,11 @@ public class RtkInfoController {
             rtkInfo.setPassword(null);
             rtkInfo.setOperator(null);
         }
-        Camera camera = cameraService.getBySnCode(rtkInfo.getCameraSnCode());
-        if(camera == null){
-            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
+        if(StringUtils.isNotBlank(rtkInfo.getCameraSnCode())){
+            Camera camera = cameraService.getBySnCode(rtkInfo.getCameraSnCode());
+            if(camera == null){
+                throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
+            }
         }
         rtkInfoService.saveOrEdit(rtkInfo);
         return ResultData.ok();

+ 2 - 2
src/main/java/com/fdkankan/manage/controller/SceneController.java

@@ -128,8 +128,8 @@ public class SceneController {
      * num      场景码
      */
     @GetMapping("/rebuildScene")
-    public ResultData rebuild(@RequestParam(required = false) String num){
-        sceneProService.rebuildScene(num);
+    public ResultData rebuild(@RequestParam(required = false) String num,@RequestParam(required = false) String from){
+        sceneProService.rebuildScene(num,from);
         return ResultData.ok();
     }
 

+ 1 - 1
src/main/java/com/fdkankan/manage/entity/RtkInfo.java

@@ -81,7 +81,7 @@ public class RtkInfo implements Serializable {
     /**
      *  0千寻板卡千寻账号,1千寻板卡移动账号,2北云板卡移动账号
      */
-    @TableField("rtk_type")
+    @TableField(value = "rtk_type",updateStrategy = FieldStrategy.IGNORED)
     private Integer rtkType ;
 
     @TableField("rec_status")

+ 2 - 2
src/main/java/com/fdkankan/manage/inner/controller/InnerController.java

@@ -57,8 +57,8 @@ public class InnerController extends BaseController {
     }
 
     @GetMapping("/rebuildScene")
-    public ResultData rebuild(@RequestParam(required = false) String num){
-        sceneProService.rebuildScene(num);
+    public ResultData rebuild(@RequestParam(required = false) String num,@RequestParam(required = false) String from){
+        sceneProService.rebuildScene(num,from);
         return ResultData.ok( );
     }
 

+ 1 - 1
src/main/java/com/fdkankan/manage/service/ISceneProService.java

@@ -52,7 +52,7 @@ public interface ISceneProService extends IService<ScenePro> {
 
     HashMap<Long,Long > getSpaceGroupByCameraId();
 
-    void rebuildScene(String num);
+    void rebuildScene(String num,String from);
 
     Long getSpaceSumByCameraId(Long cameraId);
 

+ 3 - 2
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -273,6 +273,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                     record.setIsObj(ssObj.getInteger("buildObjStatus"));
                     record.setViewCount(ssObj.getInteger("viewCount"));
                     record.setStatus(toFdStatus(ssObj.getInteger("status")));
+                    record.setAlgorithmTime(ssObj.getString("algorithmTime"));
                 }else{
                     record.setStatus(-1);
                     record.setWebSite(null);
@@ -784,7 +785,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     }
 
     @Override
-    public void rebuildScene(String num) {
+    public void rebuildScene(String num,String from) {
         String redisKey2 = String.format(RedisKeyUtil.numShootKey, num);
         redisUtil.del(redisKey2);
         String dataSource = null;
@@ -822,7 +823,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         }
         HashMap<String,Object> paramMap = new HashMap<>();
         paramMap.put("num",num);
-        paramMap.put("from","manage");
+        paramMap.put("from",from == null ? "manage":from);
         try {
             JSONObject jsonObject = fdKKClient.rebuildScene(paramMap);
             Integer code = jsonObject.getInteger("code");