lyhzzz 5 days ago
parent
commit
ede170cee6

+ 3 - 0
src/main/java/com/fdkankan/fusion/config/FusionConfig.java

@@ -21,4 +21,7 @@ public class FusionConfig {
      */
     @Value("${fusion.push-draw.url}")
     private String pushDrawUrl;
+
+    @Value("${to-haixin.server-url}")
+    private String serverUrl;
 }

+ 12 - 12
src/main/java/com/fdkankan/fusion/controller/CaseFilesController.java

@@ -121,11 +121,16 @@ public class CaseFilesController extends BaseController{
 
     @PostMapping("/updateFileType")
     public ResultData updateFileType(@RequestBody AddByMediaLibraryParam param){
-        if( param.getFilesId() == null || param.getFilesTypeId() == null){
+        if(( param.getFilesId() == null && param.getFilesIds().isEmpty() ) || param.getFilesTypeId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<CaseFiles> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(CaseFiles::getFilesId,param.getFilesId());
+        if(param.getFilesId() != null){
+            wrapper.eq(CaseFiles::getFilesId,param.getFilesId());
+        }
+        if(!param.getFilesIds().isEmpty()){
+            wrapper.in(CaseFiles::getFilesId,param.getFilesId());
+        }
         wrapper.set(CaseFiles::getFilesTypeId,param.getFilesTypeId());
         caseFilesService.update(wrapper);
         return ResultData.ok();
@@ -193,19 +198,14 @@ public class CaseFilesController extends BaseController{
 
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseFiles caseFiles ){
-        if(caseFiles.getFilesId() == null ){
+        if(caseFiles.getFilesId()!= null){
+            caseFiles.getFilesIds().add(caseFiles.getFilesId());
+        }
+        if(caseFiles.getFilesIds().isEmpty() ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        CaseFiles caseFiles1 = caseFilesService.getById(caseFiles.getFilesId());
-        caseFilesService.removeById(caseFiles.getFilesId());
+        caseFilesService.removeByIds(caseFiles.getFilesIds());
 
-        //删除认定书,案件修改为未认定
-        if(caseFiles1 != null && caseFiles1.getFilesTypeId() == 4){
-            List<CaseFiles> caseFilesList = caseFilesService.allList(caseFiles1.getCaseId(),caseFiles1.getFilesTypeId());
-            if(caseFilesList == null || caseFilesList.size() <=0){
-                caseService.updateIdenTityStatus(caseFiles1.getCaseId(),0);
-            }
-        }
         return ResultData.ok();
     }
 

+ 1 - 0
src/main/java/com/fdkankan/fusion/controller/CaseTabulationController.java

@@ -83,6 +83,7 @@ public class CaseTabulationController extends BaseController{
                     map.put("md5", MD5Checksum.getMD5(caseTabulation.getListCover().replace("/oss/", "/oss/4dkankan/")));
                     map.put("fileUrl",caseTabulation.getListCover());
                     map.put("vendor","A0BF");// 供应商类型
+                    map.put("serverUrl",fusionConfig.getServerUrl());// 供应商类型
                     otherClient.postJson(fusionConfig.getPushDrawUrl(),map);
                 }
             }

+ 5 - 1
src/main/java/com/fdkankan/fusion/entity/CaseFiles.java

@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+
 import lombok.Getter;
 import lombok.Setter;
 import scala.Int;
@@ -95,5 +98,6 @@ public class CaseFiles implements Serializable {
     @TableField("tabulation_id")
     private Integer tabulationId;
 
-
+    @TableField(exist = false)
+    private List<Integer> filesIds = new ArrayList<>();
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/entity/HotIcon.java

@@ -83,4 +83,6 @@ public class HotIcon implements Serializable {
     @TableField(exist = false)
     private List<HotIcon> childrenList;
 
+    @TableField("dict_id")
+    private Integer dictId;
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/request/AddByMediaLibraryParam.java

@@ -3,6 +3,7 @@ package com.fdkankan.fusion.request;
 import lombok.Data;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Data
@@ -13,6 +14,7 @@ public class AddByMediaLibraryParam {
     private Integer filesTypeId;
 
     private Integer filesId;
+    private List<Integer> filesIds = new ArrayList<>();
 
     private Integer imgType ;
     private String content;

+ 0 - 97
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -120,106 +120,9 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
             listAll.addAll(list1);
 
         }
-        if(listAll.size() >0){
-            List<String> numList = listAll.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
-            //设置模型
-            HashMap<String,Model> map = modelService.getMapByNum(numList);
-            for (SceneVo sceneVo : listAll) {
-                String createTime = sceneVo.getCreateTime();
-                Model model = map.get(sceneVo.getNum() + sceneVo.getType());
-                if(model == null){
-                    continue;
-                }
-                BeanUtils.copyProperties(model,sceneVo);
-                sceneVo.setCreateTime(createTime);
-            }
-        }
-        //官网删除的场景,删除对应资源
-        if(param.getTypeList() == null ){
-            for (Integer type : param.getTypeMap().keySet()) {
-                List<String> dbNumList = listAll.stream().filter(entity -> entity.getType().equals(type)).map(SceneVo::getNum).collect(Collectors.toList());
-                this.deleteNotInScene(param.getTypeMap().get(type), dbNumList,type,param.getCaseId(),listAll);
-            }
-        }
-
-
-        //相机解绑,标注,测量隐藏,视图
-        for (SceneVo sceneVo : listAll) {
-            if(!sceneVo.getBind() || (sceneVo.getStatus()!=null && sceneVo.getStatus() == 3)){
-                fusionNumService.hideOrShow(sceneVo.getModelId(),sceneVo.getNum(),1);
-            }else {
-                fusionNumService.hideOrShow(sceneVo.getModelId(),sceneVo.getNum(),0);
-            }
-        }
-        listAll.removeIf(sceneVo -> !sceneVo.getBind());
-
-        //关联的三维模型
-        if(param.getTypeList() == null ){
-            List<String> numList = param.getTypeMap().get(3);
-            if(numList!=null && numList.size() >0){
-                List<Model> models = modelService.getListByModelIdStrs(numList);
-                for (Model model : models) {
-                    SceneVo sceneVo = new SceneVo();
-                    sceneVo.setStatus(2);
-                    BeanUtils.copyProperties(model,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);
-        HashMap<Integer,FusionNum> fusionNumHashMap = fusionNumService.getByCaseId(param.getCaseId());
-
-        for (SceneVo sceneVo : listAll) {
-            if(StringUtils.isNotBlank(sceneVo.getDeptId())){
-                TmDepartment tmDepartment = mapByDept.get(sceneVo.getDeptId());
-                if(tmDepartment != null){
-                    sceneVo.setDeptName(tmDepartment.getName());
-                }
-            }
-            if(sceneVo.getModelId() != null && fusionNumHashMap.get(sceneVo.getModelId()) != null){
-                sceneVo.setInFusion(true);
-            }
-
-        }
         return listAll;
     }
 
-    private void deleteNotInScene(List<String> numList,List<String> obNumList,Integer type,Integer caseId,List<SceneVo> sceneVos) {
-        if(type == 3){  //上传的三维模型,无需处理
-            return;
-        }
-        if(numList.size() >0){
-            List<String> delNumList = new ArrayList<>();
-            for (String num : numList) {
-                if(!obNumList.contains(num)){
-                    delNumList.add(num);
-                }
-            }
-            List<String> delNumList2 = new ArrayList<>();
-            for (SceneVo sceneVo : sceneVos) {
-                if(sceneVo.getStatus() !=2 && sceneVo.getStatus() !=3 && sceneVo.getType().equals(type)){
-                    delNumList2.add(sceneVo.getNum());
-                }
-            }
-            caseNumService.deleteByNum(caseId,delNumList,type);
-            fusionNumService.deleteByNumList(caseId,delNumList2,false,type);
-        }
-    }
 
     @Override
     public void addOrUpdate(CaseEntity param) {

+ 0 - 48
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -87,21 +87,7 @@ public class SceneService implements ISceneService {
         if(param.getType() == null){
            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        List<TmCamera> tmCameraList = null;
-        String tokenValue = null;
-        try {
-             tokenValue = StpUtil.getTokenValue();
-        }catch (Exception e){
 
-        }
-
-        if(StringUtils.isNotBlank(tokenValue) && StringUtils.isBlank(param.getShare()) ){
-            tmCameraList = tmCameraService.getByDeptIds();
-            List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            if(CollectionUtil.isNotEmpty(snCodes)){
-                param.setSnCodes(snCodes);
-            }
-        }
         if(StringUtils.isNotBlank(param.getDeptId())){
             List<String> deptIds = new ArrayList<>();
             if(param.getSearchType() == 0){
@@ -119,30 +105,6 @@ public class SceneService implements ISceneService {
             }
             param.setSnCodes(snCodes);
         }
-//        if(StringUtils.isNotBlank(param.getSnCode())){
-//            List<String> snCodes = param.getSnCodes();
-//            List<String> snCodes1 = new ArrayList<>();
-//            snCodes1.add(param.getSnCode());
-//            if(snCodes == null){
-//                snCodes = snCodes1;
-//            }else {
-//                snCodes = snCodes.stream().filter(snCodes1::contains).collect(Collectors.toList());
-//            }
-//            param.setSnCodes(snCodes);
-//        }
-        if(param.getCaseId() !=null){
-            String deptId =  caseService.getDeptId(param.getCaseId());
-            List<TmCamera> tmCameras = tmCameraService.getByDeptIds(Arrays.asList(deptId));
-            List<String> snCodes = param.getSnCodes();
-            List<String> snCodes1 = tmCameras.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            snCodes1.add(param.getSnCode());
-            if(snCodes == null){
-                snCodes = snCodes1;
-            }else {
-                snCodes = snCodes.stream().filter(snCodes1::contains).collect(Collectors.toList());
-            }
-            param.setSnCodes(snCodes);
-        }
         if(CollectionUtil.isEmpty(param.getSnCodes()) && CollectionUtil.isEmpty(param.getNumList())){
             return PageInfo.PageInfoEmpty();
         }
@@ -197,16 +159,6 @@ public class SceneService implements ISceneService {
                 sceneVoList.add(vo);
             }
         }
-        Set<String> snCodes = sceneVoList.stream().map(SceneVo::getSnCode).collect(Collectors.toSet());
-
-        HashMap<String, TmDepartment> map = tmCameraService.getMapBySnCodes(snCodes);
-        for (SceneVo sceneVo : sceneVoList) {
-            TmDepartment tmDepartment = map.get(sceneVo.getSnCode().toUpperCase());
-            if(tmDepartment != null){
-                sceneVo.setDeptId(tmDepartment.getId());
-                sceneVo.setDeptName(tmDepartment.getName());
-            }
-        }
         Page<SceneVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());
         voPage.setRecords(sceneVoList);
         voPage.setTotal(total);

+ 3 - 0
src/main/resources/bootstrap-dev.yml

@@ -14,6 +14,9 @@ spring:
           - data-id: common-rabbitmq-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 3 - 0
src/main/resources/bootstrap-test.yml

@@ -14,6 +14,9 @@ spring:
           - data-id: common-rabbitmq-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}