|  | @@ -11,13 +11,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.constant.DictConstants;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.constant.ErrorMsgConstants;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.constant.SecurityConstants;
 | 
	
		
			
				|  |  | -import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingPlan;
 | 
	
		
			
				|  |  | -import com.xunmei.common.core.domain.edu.vo.CoreEduTrainingPlanDataVo;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.domain.registerbook.domain.CoreRegisterBookPdf;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.domain.retrieval.domain.CoreMonitoringRetrievalTask;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.enums.OrgTypeEnum;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.enums.RegisterBookType;
 | 
	
		
			
				|  |  | -import com.xunmei.common.core.enums.edu.EduTrainingPlanStatus;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.exception.ServiceException;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.exception.SystemException;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.thread.ThreadPoolConfig;
 | 
	
	
		
			
				|  | @@ -40,10 +37,7 @@ import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 | 
	
		
			
				|  |  |  import com.xunmei.core.retrieval.mapper.CoreMonitoringRetrievalTaskMapper;
 | 
	
		
			
				|  |  |  import com.xunmei.core.retrieval.service.ICoreMonitoringRetrievalTaskBuilderService;
 | 
	
		
			
				|  |  |  import com.xunmei.core.retrieval.service.ICoreMonitoringRetrievalTaskService;
 | 
	
		
			
				|  |  | -import com.xunmei.system.api.RemoteFileService;
 | 
	
		
			
				|  |  | -import com.xunmei.system.api.RemoteOrgService;
 | 
	
		
			
				|  |  | -import com.xunmei.system.api.RemoteRoleService;
 | 
	
		
			
				|  |  | -import com.xunmei.system.api.RemoteUserService;
 | 
	
		
			
				|  |  | +import com.xunmei.system.api.*;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.domain.*;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
 | 
	
		
			
				|  |  |  import io.netty.util.internal.StringUtil;
 | 
	
	
		
			
				|  | @@ -61,9 +55,11 @@ import javax.annotation.Resource;
 | 
	
		
			
				|  |  |  import java.io.File;
 | 
	
		
			
				|  |  |  import java.text.ParseException;
 | 
	
		
			
				|  |  |  import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  | -import java.time.Duration;
 | 
	
		
			
				|  |  |  import java.time.LocalDate;
 | 
	
		
			
				|  |  | -import java.util.*;
 | 
	
		
			
				|  |  | +import java.util.ArrayList;
 | 
	
		
			
				|  |  | +import java.util.Calendar;
 | 
	
		
			
				|  |  | +import java.util.Date;
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.concurrent.CompletableFuture;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -111,7 +107,8 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      @Qualifier(ThreadPoolConfig.SOC_EXECUTOR)
 | 
	
		
			
				|  |  |      private ThreadPoolTaskExecutor threadPoolTaskExecutor;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private RemoteDictDataService dictDataService;
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public TableDataInfo selectPage(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
 | 
	
		
			
				|  |  |          //未删除
 | 
	
	
		
			
				|  | @@ -1363,6 +1360,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 | 
	
		
			
				|  |  |      @Transactional
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlanDto tMonitoringRetrievalPlanDto) throws ParseException {
 | 
	
		
			
				|  |  | +        Integer result=1;
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              TMonitoringRetrievalPlan newPlan =new TMonitoringRetrievalPlan();
 | 
	
		
			
				|  |  |              BeanUtils.copyProperties(tMonitoringRetrievalPlanDto, newPlan);
 | 
	
	
		
			
				|  | @@ -1402,25 +1400,9 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 | 
	
		
			
				|  |  |                      // 编辑的非行社创建计划,需处理子计划
 | 
	
		
			
				|  |  |                      if(oldPlan.getOrgType()!="3")
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -//                        SysOrg oldPlanOrg = remoteOrgService.selectSysOrgById(oldPlan.getOrgId(), SecurityConstants.INNER);
 | 
	
		
			
				|  |  | -//                        List<TMonitoringRetrievalPlan> subPlans= buildSubPlans(oldPlan,tMonitoringRetrievalPlanDto.getPlanExecOrgIdList(),oldPlanOrg);
 | 
	
		
			
				|  |  | -//                        List<TMonitoringRetrievalPlanToExecOrg> planToExecOrgs=new ArrayList<>();
 | 
	
		
			
				|  |  | -//                        if(ObjectUtil.isNotEmpty(tMonitoringRetrievalPlanDto.getPlanExecOrgIdList()))
 | 
	
		
			
				|  |  | -//                        {
 | 
	
		
			
				|  |  | -//                            final List<SysOrg> sysOrgs = RemoteCallHandlerExecutor.executeRemoteCall(() ->
 | 
	
		
			
				|  |  | -//                                            remoteOrgService.selectOrgByIdList(tMonitoringRetrievalPlanDto.getPlanExecOrgIdList(), SecurityConstants.INNER),
 | 
	
		
			
				|  |  | -//                                    ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
 | 
	
		
			
				|  |  | -//                            planToExecOrgs = buildPlanExecOrgs(subPlans, sysOrgs);
 | 
	
		
			
				|  |  | -//                        }
 | 
	
		
			
				|  |  | -//                        //保存子计划和子计划具体执行机构
 | 
	
		
			
				|  |  | -//                        if(ObjectUtil.isNotEmpty(subPlans))
 | 
	
		
			
				|  |  | -//                        {
 | 
	
		
			
				|  |  | -//                            this.saveBatch(subPlans);
 | 
	
		
			
				|  |  | -//                            itMonitoringRetrievalPlanToExecOrgService.saveBatch(planToExecOrgs);
 | 
	
		
			
				|  |  | -//                        }
 | 
	
		
			
				|  |  |                          iCoreMonitoringRetrievalTaskService.updateComplete(!isComplete, newPlan, oldPlan);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    return 1;
 | 
	
		
			
				|  |  | +                    return result;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  else // 任务中存在已完成的任务,只能修改任务名称
 | 
	
		
			
				|  |  |                  {
 | 
	
	
		
			
				|  | @@ -1431,26 +1413,31 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 | 
	
		
			
				|  |  |                      if(ObjectUtil.isNotEmpty(subPlanList))
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          subPlanList.forEach(x->x.setPlanName(oldPlan.getPlanName()));
 | 
	
		
			
				|  |  | -                        this.saveBatch(subPlanList);
 | 
	
		
			
				|  |  | +                        this.saveOrUpdateBatch(subPlanList);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -//                    CompletableFuture.runAsync(() -> {
 | 
	
		
			
				|  |  | -//                        try{
 | 
	
		
			
				|  |  | -//                            clearTaskByPlanId(oldPlan.getId());
 | 
	
		
			
				|  |  | -//                            distribute(oldPlan.getId(),true);
 | 
	
		
			
				|  |  | -//                        }
 | 
	
		
			
				|  |  | -//                        catch (Exception e) {
 | 
	
		
			
				|  |  | -//                            e.getMessage();
 | 
	
		
			
				|  |  | -//                        }
 | 
	
		
			
				|  |  | -//                    }, threadPoolTaskExecutor);
 | 
	
		
			
				|  |  | +                    return result;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                return 0;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            // 停用状态 肯定存在已完成的任务, 只能修改任务名称
 | 
	
		
			
				|  |  | +            else if(oldPlan.getPlanStatus()==2)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                tMonitoringRetrievalPlanMapper.updateById(oldPlan);
 | 
	
		
			
				|  |  | +                QueryWrapper queryWrapper = new QueryWrapper();
 | 
	
		
			
				|  |  | +                queryWrapper.eq(PARENT_ID, oldPlan.getId());
 | 
	
		
			
				|  |  | +                List<TMonitoringRetrievalPlan> subPlanList = tMonitoringRetrievalPlanMapper.selectList(queryWrapper);
 | 
	
		
			
				|  |  | +                if(ObjectUtil.isNotEmpty(subPlanList))
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    subPlanList.forEach(x->x.setPlanName(oldPlan.getPlanName()));
 | 
	
		
			
				|  |  | +                    this.saveOrUpdateBatch(subPlanList);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return result;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          catch (Exception e) {
 | 
	
		
			
				|  |  |              e.getMessage();
 | 
	
		
			
				|  |  |              return 0;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return 0;
 | 
	
		
			
				|  |  | +        return result;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // 根据计划Id清除计划下的所有任务
 | 
	
	
		
			
				|  | @@ -1609,8 +1596,12 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 | 
	
		
			
				|  |  |          accessPdf.setOrgName(accessPdfVO.getOrgName());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          List<AccessDataVo> accessDataVos = baseMapper.selectPointByTask(accessPdfVO.getTaskId());
 | 
	
		
			
				|  |  | +        List<SysDictData> sysDictData = dictDataService.selectAllDictByeTypeFormDB(DictConstants.CORE_REGISTRATION_PROJECT, SecurityConstants.INNER);
 | 
	
		
			
				|  |  |          for (AccessDataVo vo : accessDataVos) {
 | 
	
		
			
				|  |  |              vo.setProject(DictUtils.getDictLabel(DictConstants.CORE_REGISTRATION_PROJECT, Integer.parseInt(vo.getProject())));
 | 
	
		
			
				|  |  | +            if (ObjectUtil.isEmpty(vo.getProject())){
 | 
	
		
			
				|  |  | +                sysDictData.stream().filter(d->d.getDictValue().equals(vo.getProject())).findFirst().ifPresent(d->vo.setProject(d.getDictLabel()));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          accessPdf.setDataVos(accessDataVos);
 | 
	
		
			
				|  |  |          accessPdf.setSignImg(getFileRealPath(accessDataVos.get(0).getSignImg(), prefixPath, staticsPath));
 |