|
|
@@ -72,6 +72,8 @@ import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.transaction.support.TransactionSynchronization;
|
|
|
+import org.springframework.transaction.support.TransactionSynchronizationManager;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
@@ -268,15 +270,21 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
|
|
|
List<Long> roleList = appPlanToRoleMapper.selectList(new LambdaQueryWrapper<AppPlanToRole>().eq(AppPlanToRole::getPlanId, dto.getId())).stream().map(AppPlanToRole::getRoleId).collect(Collectors.toList());
|
|
|
AppPlanToRole atr = null;
|
|
|
+ List<AppPlanToRole> planToRoles=new ArrayList<>();
|
|
|
for (Long roleId : roleList) {
|
|
|
atr = new AppPlanToRole();
|
|
|
atr.setRoleId(roleId);
|
|
|
atr.setPlanId(id);
|
|
|
- appPlanToRoleMapper.insert(atr);
|
|
|
+ planToRoles.add(atr);
|
|
|
+// appPlanToRoleMapper.insert(atr);
|
|
|
+ }
|
|
|
+ if(planToRoles.size()!=0){
|
|
|
+ appPlanToRoleMapper.batchInsertData(planToRoles);
|
|
|
}
|
|
|
|
|
|
List<AppPlanToPoint> itemList = appPlanToItemMapper.selectList(new LambdaQueryWrapper<AppPlanToPoint>().eq(AppPlanToPoint::getPlanId, dto.getId()));
|
|
|
AppPlanToPoint item = null;
|
|
|
+ List<AppPlanToPoint> planToPoints =new ArrayList<>();
|
|
|
for (AppPlanToPoint ruleItemVo : itemList) {
|
|
|
item = new AppPlanToPoint();
|
|
|
item.setPointId(ruleItemVo.getPointId());
|
|
|
@@ -284,16 +292,28 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
item.setPointScan(ruleItemVo.isPointScan());
|
|
|
item.setRequired(ruleItemVo.isRequired());
|
|
|
item.setOfOrgId(ruleItemVo.getOfOrgId());
|
|
|
+ planToPoints.add(item);
|
|
|
// item.setEffectiveDate(ruleItemVo.getEffectiveDate());
|
|
|
- appPlanToItemMapper.insert(item);
|
|
|
+// appPlanToItemMapper.insert(item);
|
|
|
+ }
|
|
|
+ if(planToPoints.size()!=0)
|
|
|
+ {
|
|
|
+ appPlanToItemMapper.batchInsertData(planToPoints);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
List<AppPlanToExecOrg> execOrgs = appPlanToExecOrgMapper.selectList(new LambdaQueryWrapper<AppPlanToExecOrg>().eq(AppPlanToExecOrg::getPlanId, dto.getId()));
|
|
|
+ List<AppPlanToExecOrg> planToExecOrgs=new ArrayList<>();
|
|
|
for (AppPlanToExecOrg execOrg : execOrgs) {
|
|
|
AppPlanToExecOrg n = new AppPlanToExecOrg();
|
|
|
n.setPlanId(id);
|
|
|
n.setOrgId(execOrg.getOrgId());
|
|
|
- appPlanToExecOrgMapper.insert(n);
|
|
|
+ planToExecOrgs.add(n);
|
|
|
+// appPlanToExecOrgMapper.insert(n);
|
|
|
+ }
|
|
|
+ if(planToExecOrgs.size()!=0)
|
|
|
+ {
|
|
|
+ appPlanToExecOrgMapper.batchInsertData(planToExecOrgs);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -321,7 +341,12 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
}
|
|
|
|
|
|
if (immediateEffect) {
|
|
|
- resumptionTaskBusiness.rebuildCurrentCycleTask(hsPlans, dto.getId());
|
|
|
+ TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
|
|
+ @Override
|
|
|
+ public void afterCommit() {
|
|
|
+ resumptionTaskBusiness.rebuildCurrentCycleTask(hsPlans, dto.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|