|
|
@@ -16,6 +16,7 @@ import com.xunmei.common.core.constant.ErrorMsgConstants;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.DateRange;
|
|
|
import com.xunmei.common.core.domain.IdName;
|
|
|
+import com.xunmei.common.core.domain.drill.domain.CoreDrillPlan;
|
|
|
import com.xunmei.common.core.domain.edu.domain.*;
|
|
|
import com.xunmei.common.core.domain.edu.dto.CoreEduTrainingPlanEditDto;
|
|
|
import com.xunmei.common.core.domain.edu.dto.CoreEduTrainingPlanInsertDto;
|
|
|
@@ -244,6 +245,17 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
|| ObjectUtil.equal(orgType, OrgTypeEnum.HANG_SHE.getCode());
|
|
|
}
|
|
|
|
|
|
+ private Boolean anotherCheckOrgType(Integer orgType) {
|
|
|
+ if (ObjectUtil.isEmpty(orgType)) {
|
|
|
+ throw new RuntimeException("当前用户所在机构类型无法确认!");
|
|
|
+ }
|
|
|
+ //如果是省联社或者办事处及行社
|
|
|
+ return ObjectUtil.equal(orgType, OrgTypeEnum.SHEGN_LIAN_SHE.getCode())
|
|
|
+ || ObjectUtil.equal(orgType, OrgTypeEnum.BAN_SHI_CHU.getCode())
|
|
|
+ || ObjectUtil.equal(orgType, OrgTypeEnum.HANG_SHE.getCode())
|
|
|
+ || ObjectUtil.equal(orgType, OrgTypeEnum.YINGYE_WANGDIAN.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改教育培训计划
|
|
|
*
|
|
|
@@ -368,9 +380,6 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
} else {
|
|
|
planList = ListUtil.list(true, plan);
|
|
|
}
|
|
|
- if (checkOrgType(plan.getExecOrgType())) {
|
|
|
- planList.add(plan);
|
|
|
- }
|
|
|
//List<CoreEduTrainingPlan> planList = buildPlanData(plan, null, false);
|
|
|
List<CoreEduTrainingPlan> finalPlanList = planList;
|
|
|
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
|
|
|
@@ -597,8 +606,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<SysOrgVO> getPlanExecOrg(CoreEduTrainingPlan plan) {
|
|
|
- List<SysOrgVO> all = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
|
|
|
+ private List<SysOrgVO> getPlanExecOrg(CoreEduTrainingPlan plan, List<SysOrgVO> all) {
|
|
|
QueryWrapper<CoreEduTrainingPlanToExecOrg> eos = new QueryWrapper<>();
|
|
|
eos.lambda().eq(CoreEduTrainingPlanToExecOrg::getPlanId, plan.getId());
|
|
|
final List<CoreEduTrainingPlanToExecOrg> coreEduTrainingPlanToExecOrgs = coreEduTrainingPlanToExecOrgMapper.selectList(eos);
|
|
|
@@ -635,10 +643,6 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
List<Long> collect = planList.stream().map(CoreEduTrainingPlan::getId).collect(Collectors.toList());
|
|
|
coreEduTrainingPlanMapper.updatePlanStatusByIdList(collect, EduTrainingPlanStatus.USING.getCode());
|
|
|
}
|
|
|
- if (checkOrgType(plan.getExecOrgType())) {
|
|
|
- planList.add(plan);
|
|
|
- plan.setParentId(planId);
|
|
|
- }
|
|
|
//下发后修改为使用中
|
|
|
plan.setPlanStatus(EduTrainingPlanStatus.USING.getCode());
|
|
|
plan.setIssue(1);
|
|
|
@@ -689,16 +693,23 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
ros.eq(CoreEduTrainingPlanToRole::getPlanId, plan.getId());
|
|
|
planRoleList = coreEduTrainingPlanToRoleMapper.selectList(ros);
|
|
|
}*/
|
|
|
+ List<SysOrgVO> all = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
|
|
|
+ final SysOrgVO planCreateOrg = all.stream().filter(org -> org.getId().equals(plan.getCreateOrgId())).findFirst().get();
|
|
|
+ final long count = all.stream()
|
|
|
+ .filter(org -> ObjectUtil.isNotEmpty(org.getPath()))
|
|
|
+ .filter(org -> ObjectUtil.notEqual(org.getId(),plan.getCreateOrgId()))
|
|
|
+ .filter(org -> org.getPath().startsWith(planCreateOrg.getPath()))
|
|
|
+ .filter(org -> OrgTypeEnum.HANG_SHE.getCode().equals(org.getType()))
|
|
|
+ .count();
|
|
|
+ if (count == 0) {
|
|
|
+ plan.setParentId(plan.getId());
|
|
|
+ List<CoreEduTrainingPlan> list = new ArrayList<>();
|
|
|
+ list.add(plan);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
//获取计划具体执行机构
|
|
|
- final List<SysOrgVO> planExecOrgList = this.getPlanExecOrg(plan);
|
|
|
+ final List<SysOrgVO> planExecOrgList = this.getPlanExecOrg(plan, all);
|
|
|
List<SysOrgVO> planPublishOrgList = getPlanPublishOrgList(planExecOrgList);
|
|
|
- //这里考虑到行社用户新建计划指定执行机构类型为营业网点时,会再次把当前行社查询出来,
|
|
|
- // 导致行社下发会再次新增一条子计划,所以这里需要喊出当前行社机构id
|
|
|
- planPublishOrgList.removeIf(org -> ObjectUtil.equal(org.getId(), SecurityUtils.getLoginUser().getSysUser().getOrgId()));
|
|
|
- if (planPublishOrgList.isEmpty()) {
|
|
|
- //如果满足的话,需要把当前计划的parentId设置成id
|
|
|
- return new ArrayList<>();
|
|
|
- }
|
|
|
List<CoreEduTrainingPlanToExecOrg> planToExecOrgs = new ArrayList<>();
|
|
|
List<CoreEduTrainingPlan> list = new ArrayList<>();
|
|
|
for (SysOrgVO sysOrg : planPublishOrgList) {
|