lyhzzz 4 miesięcy temu
rodzic
commit
b1ea41536f

+ 5 - 0
src/main/java/com/fdkankan/fusion/controller/SceneDeptShareController.java

@@ -31,6 +31,11 @@ public class SceneDeptShareController {
         sceneDeptShareService.share(param);
         sceneDeptShareService.share(param);
         return ResultData.ok();
         return ResultData.ok();
     }
     }
+    @PostMapping("/shareAuthList")
+    public ResultData shareAuthList(@RequestBody SceneDeptShare param){
+        return ResultData.ok(sceneDeptShareService.shareAuthList(param));
+    }
+
 
 
 }
 }
 
 

+ 4 - 0
src/main/java/com/fdkankan/fusion/entity/SceneDeptShare.java

@@ -61,4 +61,8 @@ public class SceneDeptShare implements Serializable {
 
 
     @TableField("fusion_id")
     @TableField("fusion_id")
     private Integer fusionId;
     private Integer fusionId;
+
+
+    @TableField(exist = false)
+    private Integer mapShow = 0;
 }
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/ICaseService.java

@@ -44,4 +44,6 @@ public interface ICaseService extends IService<CaseEntity> {
     Object getFusionAndScene(Integer caseId, String type);
     Object getFusionAndScene(Integer caseId, String type);
 
 
     void addFusionIds(CaseParam param);
     void addFusionIds(CaseParam param);
+
+    void setMapShow(Integer caseId, Integer mapShow);
 }
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/service/ISceneDeptShareService.java

@@ -20,4 +20,6 @@ public interface ISceneDeptShareService extends IService<SceneDeptShare> {
     List<String> getNumListByDeptId(String deptId, Integer isObj);
     List<String> getNumListByDeptId(String deptId, Integer isObj);
 
 
     List<Integer> getFusionIdsListByDeptId(String deptId);
     List<Integer> getFusionIdsListByDeptId(String deptId);
+
+    List<SceneDeptShare>  shareAuthList(SceneDeptShare param);
 }
 }

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

@@ -4,6 +4,7 @@ import cn.dev33.satoken.context.SaHolder;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.ResultData;
@@ -369,4 +370,12 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
 
 
         return voList;
         return voList;
     }
     }
+
+    @Override
+    public void setMapShow(Integer caseId, Integer mapShow) {
+        LambdaUpdateWrapper<CaseEntity> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseEntity::getCaseId,caseId);
+        wrapper.set(CaseEntity::getMapShow,mapShow);
+        this.update(wrapper);
+    }
 }
 }

+ 38 - 2
src/main/java/com/fdkankan/fusion/service/impl/SceneDeptShareServiceImpl.java

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.RedisKeyUtil;
 import com.fdkankan.fusion.common.util.RedisKeyUtil;
+import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.entity.SceneDeptShare;
 import com.fdkankan.fusion.entity.SceneDeptShare;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.ISceneDeptShareMapper;
 import com.fdkankan.fusion.mapper.ISceneDeptShareMapper;
+import com.fdkankan.fusion.service.ICaseService;
 import com.fdkankan.fusion.service.ISceneDeptShareService;
 import com.fdkankan.fusion.service.ISceneDeptShareService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.redis.util.RedisUtil;
@@ -30,6 +32,8 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
 
 
     @Autowired
     @Autowired
     RedisUtil redisUtil;
     RedisUtil redisUtil;
+    @Autowired
+    ICaseService caseService;
     @Override
     @Override
     public void share(SceneDeptShare param) {
     public void share(SceneDeptShare param) {
         if(((StringUtils.isBlank(param.getNum()) || param.getIsObj() == null) && param.getCaseId() == null)
         if(((StringUtils.isBlank(param.getNum()) || param.getIsObj() == null) && param.getCaseId() == null)
@@ -40,10 +44,12 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
         if(StringUtils.isNotBlank(param.getNum())){
         if(StringUtils.isNotBlank(param.getNum())){
             wrapper.eq(SceneDeptShare::getNum,param.getNum());
             wrapper.eq(SceneDeptShare::getNum,param.getNum());
             wrapper.eq(SceneDeptShare::getIsObj,param.getIsObj());
             wrapper.eq(SceneDeptShare::getIsObj,param.getIsObj());
-        }else {
+        }else if(param.getFusionId() != null){
+            wrapper.eq(SceneDeptShare::getFusionId,param.getFusionId());
+        }else if(param.getCaseId() != null){
             wrapper.eq(SceneDeptShare::getCaseId,param.getCaseId());
             wrapper.eq(SceneDeptShare::getCaseId,param.getCaseId());
         }
         }
-        wrapper.eq(SceneDeptShare::getDeptId,param.getDeptId());
+        //wrapper.eq(SceneDeptShare::getDeptId,param.getDeptId());
         List<SceneDeptShare> list = this.list(wrapper);
         List<SceneDeptShare> list = this.list(wrapper);
         if(param.getCaseId() != null && param.getShareAuth() ==0){
         if(param.getCaseId() != null && param.getShareAuth() ==0){
             String redisKey = String.format(RedisKeyUtil.RAND_CODE_KEY,param.getCaseId());
             String redisKey = String.format(RedisKeyUtil.RAND_CODE_KEY,param.getCaseId());
@@ -56,8 +62,12 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
             wrapper2.eq(SceneDeptShare::getId,list.get(0).getId());
             wrapper2.eq(SceneDeptShare::getId,list.get(0).getId());
             wrapper2.set(SceneDeptShare::getIsAuth,param.getIsAuth());
             wrapper2.set(SceneDeptShare::getIsAuth,param.getIsAuth());
             wrapper2.set(SceneDeptShare::getShareAuth,param.getShareAuth());
             wrapper2.set(SceneDeptShare::getShareAuth,param.getShareAuth());
+            wrapper2.set(SceneDeptShare::getDeptId,param.getDeptId());
             this.update(wrapper2);
             this.update(wrapper2);
         }
         }
+        if(param.getCaseId() != null){
+            caseService.setMapShow(param.getCaseId(),param.getMapShow());
+        }
 
 
 
 
     }
     }
@@ -80,4 +90,30 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
         List<SceneDeptShare> list = this.list(wrapper);
         List<SceneDeptShare> list = this.list(wrapper);
         return list.stream().map(SceneDeptShare::getCaseId).collect(Collectors.toList());
         return list.stream().map(SceneDeptShare::getCaseId).collect(Collectors.toList());
     }
     }
+
+
+    @Override
+    public  List<SceneDeptShare>  shareAuthList(SceneDeptShare param) {
+        LambdaQueryWrapper<SceneDeptShare> wrapper = new LambdaQueryWrapper<>();
+        if(StringUtils.isNotBlank(param.getNum()) && param.getIsObj() !=null){
+            wrapper.eq(SceneDeptShare::getNum,param.getNum());
+            wrapper.eq(SceneDeptShare::getIsObj,param.getIsObj());
+        }
+        if(param.getCaseId() != null){
+            wrapper.eq(SceneDeptShare::getCaseId,param.getCaseId());
+        }
+        if(param.getFusionId() != null){
+            wrapper.eq(SceneDeptShare::getFusionId,param.getFusionId());
+        }
+        List<SceneDeptShare> list = this.list(wrapper);
+        for (SceneDeptShare sceneDeptShare : list) {
+            if(sceneDeptShare.getCaseId()!=null){
+                CaseEntity caseEntity = caseService.getById(sceneDeptShare.getCaseId());
+                if(caseEntity != null){
+                    sceneDeptShare.setMapShow(caseEntity.getMapShow()?1:0);
+                }
+            }
+        }
+        return list;
+    }
 }
 }