|
|
@@ -15,6 +15,7 @@ import com.fdkankan.fusion.mapper.ICaseMapper;
|
|
|
import com.fdkankan.fusion.request.CaseParam;
|
|
|
import com.fdkankan.fusion.request.ScenePram;
|
|
|
import com.fdkankan.fusion.response.CaseVo;
|
|
|
+import com.fdkankan.fusion.response.FusionAndSceneVo;
|
|
|
import com.fdkankan.fusion.response.HotVo;
|
|
|
import com.fdkankan.fusion.response.SceneVo;
|
|
|
import com.fdkankan.fusion.service.*;
|
|
|
@@ -63,6 +64,8 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
|
|
|
IMapConfigService mapConfigService;
|
|
|
@Autowired
|
|
|
IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ ICaseFusionService caseFusionService;
|
|
|
|
|
|
@Override
|
|
|
public PageInfo pageList(CaseParam param,String userName) {
|
|
|
@@ -296,4 +299,62 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void addFusionIds(CaseParam param) {
|
|
|
+ if(param.getCaseId() == null || param.getFusionIds() == null ){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ if(param.getFusionIds().isEmpty()){
|
|
|
+ List<CaseNumEntity> byCaseId = caseNumService.getByCaseId(param.getCaseId());
|
|
|
+ if(byCaseId.isEmpty()){
|
|
|
+ throw new BusinessException(ResultCode.REMOVE_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ caseFusionService.addFusionIds(param.getFusionIds(),param.getCaseId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FusionAndSceneVo> getFusionAndScene(Integer caseId, String type) {
|
|
|
+ if(caseId == null || StringUtils.isBlank(type)){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ List<FusionAndSceneVo> voList = new ArrayList<>();
|
|
|
+ if("fusion".equals(type)){
|
|
|
+ List<CaseFusion> byCaseId = caseFusionService.getListByCaseId(caseId);
|
|
|
+ for (CaseFusion caseFusion : byCaseId) {
|
|
|
+ FusionAndSceneVo vo = new FusionAndSceneVo();
|
|
|
+ vo.setTitle(caseFusion.getFusionTitle());
|
|
|
+ vo.setFusionId(caseFusion.getFusionId());
|
|
|
+ vo.setType("fusion");
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
+ if("scene".equals(type)){
|
|
|
+ List<CaseNumEntity> caseNums = caseNumService.getByCaseId(caseId);
|
|
|
+
|
|
|
+ List<String> numList = caseNums.stream().map(CaseNumEntity::getNum).collect(Collectors.toList());
|
|
|
+ List<ScenePlus> scenePlusList = scenePlusService.getByNumList(numList);
|
|
|
+ HashMap<String, ScenePlus> map = new HashMap<>();
|
|
|
+ scenePlusList.forEach(e-> map.put(e.getNum(),e));
|
|
|
+
|
|
|
+ for (CaseNumEntity caseNum : caseNums) {
|
|
|
+ ScenePlus scenePlus = map.get(caseNum.getNum());
|
|
|
+ if(scenePlus == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ FusionAndSceneVo vo = new FusionAndSceneVo();
|
|
|
+ vo.setSceneNumId(caseNum.getId());
|
|
|
+ vo.setTitle(scenePlus.getTitle());
|
|
|
+ vo.setNum(scenePlus.getNum());
|
|
|
+ vo.setSceneType(caseNum.getNumType());
|
|
|
+ vo.setType("scene");
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
+
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
}
|