jiawuxian 1 жил өмнө
parent
commit
6e6e921a30

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/service/ResumptionServiceImpl.java

@@ -168,6 +168,7 @@ public class ResumptionServiceImpl implements ResumptionService {
             for (ResumptionPointVo point : points) {
                 data = new AppResumptionData();
                 Long pointId = IdWorker.getId(data);
+                data.setId(pointId);
                 data.setDataStatus(point.getDataStatus());
                 data.setResumptionId(taskId);
                 data.setAreaId(check.getAreaId());
@@ -233,7 +234,7 @@ public class ResumptionServiceImpl implements ResumptionService {
                 for (AppResumptionDataRemarkimg img : imgs) {
                     img.setResumptionDataId(pointId);
                     img.setResumptionId(taskId);
-                    IdWorker.getId(img);
+                    img.setId(IdWorker.getId(img));
                     //appResumptionDataRemarkimgMapper.insert(img);
                 }
                 adImgs.addAll(imgs);

+ 7 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -400,7 +400,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
                 .ne(Resumption::getStatus, ResumptionTaskStatus.Completed.getCode())
                 .and(w ->
                         w.ge(Resumption::getYmdDate, date)
-                                .or(w1 -> w1.le(Resumption::getPlanEndTime, date))
+                                .or(w1 -> w1.ge(Resumption::getPlanEndTime, date))
                 ));
     }
 
@@ -534,7 +534,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
             //任务为使用中且有已完成或停用,则下个周期生效,需要副本;任务为使用中且无已完成,则删除所有任务,并重新生成任务
             Boolean needCopy = (ObjectUtil.equal(app.getTaskHasCompleted(), 1)
-                    && ObjectUtil.equal(existPlan.getPlanStatus(), PlanStatus.USING.getCode())) || ObjectUtil.equal(existPlan.getPlanStatus(), PlanStatus.DELETED.getCode());
+                    && ObjectUtil.equal(existPlan.getPlanStatus(), PlanStatus.USING.getCode()))
+                    || ObjectUtil.equal(existPlan.getPlanStatus(), PlanStatus.DELETED.getCode());
             List<Object> needRebuildPlans = new ArrayList<>();
             //修改所有子计划
             List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()));
@@ -548,10 +549,12 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
                     baseMapper.copyChildren(ap.getId(), newChildPlanId, newPlanID);
                     baseMapper.copyPlanOrgs(ap.getId(), newChildPlanId);
                     baseMapper.copyPlanRoles(ap.getId(), newChildPlanId);
-                    baseMapper.copyPlanPoints(ap.getId(), newChildPlanId);
+                    Integer c= baseMapper.copyPlanPoints(ap.getId(), newChildPlanId);
 
                     baseMapper.updateById(ap);
                     baseMapper.deleteById(ap.getId());
+
+                    child=baseMapper.selectById(newChildPlanId);
                 } else {
                     needRebuildPlans.add(child);
                 }
@@ -704,7 +707,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             plan.setPlanCreateOrgName(null);
             baseMapper.updateById(plan);
 
-            if (needCopy && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode().longValue())) {
+            if (!needCopy && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode().longValue())) {
                 needRebuildPlans.add(baseMapper.selectById(plan.getId()));
             }
             resumptionTaskBusiness.rebuildCurrentCycleTask(needRebuildPlans);