Browse Source

计划复制问题处理

linzhiwei 2 năm trước cách đây
mục cha
commit
ec69e4e72e

+ 3 - 4
src/main/java/com/tofly/zmrq/custom/service/impl/CustomPlanServiceImpl.java

@@ -241,6 +241,7 @@ public class CustomPlanServiceImpl implements CustomPlanService {
                         List<PlanChild> list = planChildService.list(new QueryWrapper<PlanChild>().lambda().eq(PlanChild::getMainPlanId, copyPlanId)
                                 .select(PlanChild::getPointNum, PlanChild::getTotal));
                         PlanChild planChild1 = list.get(0);
+                        Long childid = planChild1.getId();
                         planChild.setPointNum(planChild1.getPointNum() == null ? 0 : planChild1.getPointNum());
                         planChild.setTotal(planChild1.getTotal() == null ? 0 : planChild1.getTotal());
                         planChildService.save(planChild);
@@ -248,12 +249,10 @@ public class CustomPlanServiceImpl implements CustomPlanService {
                         // 获取当前对应复制计划下对应类型的点/线
                         List<PlanPointTemp> pointTemps = planPointTempService
                                 .list(new QueryWrapper<PlanPointTemp>().lambda()
-                                        .eq(PlanPointTemp::getPlanId, copyPlanId)
+                                        .eq(PlanPointTemp::getChildPlanId,childid)
                                         .eq(PlanPointTemp::getDeviceTypeId, deviceTypeId));
 
-                        // 获取当前子计划id列表
-                        Set<Long> collect = pointTemps.stream().map(PlanPointTemp::getChildPlanId).collect(Collectors.toSet());
-                        List<TfPlanPathTemp> planPathTemps = planPathTempService.list(new QueryWrapper<TfPlanPathTemp>().lambda().in(TfPlanPathTemp::getChildPlanId, collect));
+                        List<TfPlanPathTemp> planPathTemps = planPathTempService.list(new QueryWrapper<TfPlanPathTemp>().lambda().eq(TfPlanPathTemp::getChildPlanId, childid));
                         // 按照原点id分组线数据
 
                         Map<Long, List<TfPlanPathTemp>> longListMap = planPathTemps.stream().collect(Collectors.groupingBy(TfPlanPathTemp::getTempId));