|
|
@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
import com.fdkankan.fusion.common.util.RedisKeyUtil;
|
|
|
+import com.fdkankan.fusion.entity.CaseEntity;
|
|
|
import com.fdkankan.fusion.entity.SceneDeptShare;
|
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.mapper.ISceneDeptShareMapper;
|
|
|
+import com.fdkankan.fusion.service.ICaseService;
|
|
|
import com.fdkankan.fusion.service.ISceneDeptShareService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
@@ -30,6 +32,8 @@ public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper
|
|
|
|
|
|
@Autowired
|
|
|
RedisUtil redisUtil;
|
|
|
+ @Autowired
|
|
|
+ ICaseService caseService;
|
|
|
@Override
|
|
|
public void share(SceneDeptShare param) {
|
|
|
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())){
|
|
|
wrapper.eq(SceneDeptShare::getNum,param.getNum());
|
|
|
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::getDeptId,param.getDeptId());
|
|
|
+ //wrapper.eq(SceneDeptShare::getDeptId,param.getDeptId());
|
|
|
List<SceneDeptShare> list = this.list(wrapper);
|
|
|
if(param.getCaseId() != null && param.getShareAuth() ==0){
|
|
|
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.set(SceneDeptShare::getIsAuth,param.getIsAuth());
|
|
|
wrapper2.set(SceneDeptShare::getShareAuth,param.getShareAuth());
|
|
|
+ wrapper2.set(SceneDeptShare::getDeptId,param.getDeptId());
|
|
|
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);
|
|
|
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;
|
|
|
+ }
|
|
|
}
|