Bladeren bron

Merge branch 'V0.1.0' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.1.0

 Conflicts:
	soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java
zhulu 1 jaar geleden
bovenliggende
commit
71936d2cdd
19 gewijzigde bestanden met toevoegingen van 190 en 474 verwijderingen
  1. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/CockpitServiceImpl.java
  2. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/web/QuestionStatisticVo.java
  3. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/ICoreDrillPlanToExecOrgService.java
  4. 24 205
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanServiceImpl.java
  5. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanToExecOrgServiceImpl.java
  6. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java
  7. 17 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/mapper/PhysicalDeleteMapper.java
  8. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/ICoreEduTrainingPlanToExecOrgService.java
  9. 20 169
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanServiceImpl.java
  10. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanToExecOrgServiceImpl.java
  11. 25 32
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java
  12. 6 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  13. 5 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/dto/ResumptionDTO.java
  14. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java
  15. 40 46
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  16. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillPlanMapper.xml
  17. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/edu/CoreEduTrainingPlanMapper.xml
  18. 20 0
      soc-modules/soc-modules-core/src/main/resources/mapper/edu/PhysicalDeleteMapper.xml
  19. 13 6
      soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/CockpitServiceImpl.java

@@ -298,9 +298,13 @@ public class CockpitServiceImpl implements CockpitService {
         vo.setDissent(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getDissentCount()));
         vo.setClosed(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getClosedCount()));
         vo.setUnreform(NumberUtils.computeRate(reformTotal, questionDto.getWaitReformCount()));
+        vo.setUnreformNums(questionDto.getWaitReformCount());
         vo.setReformed(NumberUtils.computeRate(reformTotal, questionDto.getReformedCount()));
+        vo.setReformedNums(questionDto.getReformedCount());
         vo.setOverdueReformed(NumberUtils.computeRate(reformTotal, questionDto.getOverDueReformedCount()));
+        vo.setOverdueReformedNums(questionDto.getOverDueReformedCount());
         vo.setOverdue(NumberUtils.computeRate(reformTotal, questionDto.getOverdueCount()));
+        vo.setOverdueNums(questionDto.getOverdueCount());
 //        if (overdueCount.size() == 2) {
 //            Long count = (Long) overdueCount.get("count");
 //            BigDecimal overdue = (BigDecimal) overdueCount.get("overdueCount");

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/web/QuestionStatisticVo.java

@@ -25,18 +25,22 @@ public class QuestionStatisticVo {
      * 待整改
      */
     private float unreform;
+    private float unreformNums;
     /**
      * 已整改
      */
     private float reformed;
+    private float reformedNums;
 
     /**
      * 逾期整改
      */
     private float overdueReformed;
+    private float overdueReformedNums;
 
     /**
      * 已逾期
      */
     private float overdue;
+    private float overdueNums;
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/ICoreDrillPlanToExecOrgService.java

@@ -70,5 +70,5 @@ public interface ICoreDrillPlanToExecOrgService extends IService<CoreDrillPlanTo
      */
     TableDataInfo<CoreDrillPlanToExecOrg> selectPage(CoreDrillPlanToExecOrg coreDrillPlanToExecOrg);
 
-    int deleteByParentId(List<Long> planIds);
+    int deleteByPlanIds(List<Long> planIds);
 }

+ 24 - 205
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanServiceImpl.java

@@ -1,7 +1,5 @@
 package com.xunmei.core.drill.service.impl;
 
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -20,7 +18,11 @@ 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.*;
+import com.xunmei.common.core.domain.compensate.dto.CompensateDto;
+import com.xunmei.common.core.domain.drill.domain.CoreDrillPlan;
+import com.xunmei.common.core.domain.drill.domain.CoreDrillPlanToExecOrg;
+import com.xunmei.common.core.domain.drill.domain.CoreDrillPlanToRole;
+import com.xunmei.common.core.domain.drill.domain.CoreDrillTask;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanInsertDto;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanPageDto;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanUpdateDto;
@@ -47,14 +49,15 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.redis.utils.RedisUtils;
 import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
-import com.xunmei.common.core.domain.compensate.dto.CompensateDto;
 import com.xunmei.core.compense.interfaces.CompensateService;
 import com.xunmei.core.compense.service.ICoreCompensateLogService;
-import com.xunmei.core.drill.mapper.*;
+import com.xunmei.core.drill.mapper.CoreDrillPlanMapper;
+import com.xunmei.core.drill.mapper.CoreDrillPlanToExecOrgMapper;
+import com.xunmei.core.drill.mapper.CoreDrillTaskMapper;
 import com.xunmei.core.drill.service.ICoreDrillPlanService;
 import com.xunmei.core.drill.service.ICoreDrillPlanToExecOrgService;
-import com.xunmei.core.drill.service.ICoreDrillPlanToRoleService;
 import com.xunmei.core.drill.service.ICoreDrillTaskService;
+import com.xunmei.core.edu.mapper.PhysicalDeleteMapper;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.reminder.service.ICoreReminderConfigurationService;
 import com.xunmei.core.reminder.service.ICoreReminderScheduleService;
@@ -73,8 +76,6 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.support.TransactionSynchronizationAdapter;
-import org.springframework.transaction.support.TransactionSynchronizationManager;
 
 import java.time.Duration;
 import java.util.*;
@@ -96,10 +97,6 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
     @Autowired
     private CoreDrillPlanMapper coreDrillPlanMapper;
     @Autowired
-    private CoreDrillPlanToRoleMapper coreDrillPlanToRoleMapper;
-    @Autowired
-    private ICoreDrillPlanToRoleService coreDrillPlanToRoleService;
-    @Autowired
     private ICoreDrillPlanToExecOrgService coreDrillPlanToExecOrgService;
     @Autowired
     private CoreDrillPlanToExecOrgMapper coreDrillPlanToExecOrgMapper;
@@ -108,8 +105,7 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
     @Autowired
     private CoreDrillTaskMapper coreDrillTaskMapper;
     @Autowired
-    private CoreDrillTaskToRoleMapper coreDrillTaskToRoleMapper;
-
+    private PhysicalDeleteMapper physicalDeleteMapper;
     @Autowired
     @Qualifier(ThreadPoolConfig.SOC_EXECUTOR)
     private ThreadPoolTaskExecutor threadPoolTaskExecutor;
@@ -391,11 +387,22 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
         validateFieldForStandard(request.getPlanCycle(), plan.getPlanCycle(), "当前状态仅允许修改任务名称");
         validateFieldForStandard(request.getExecTimes(), plan.getExecTimes(), "当前状态仅允许修改任务名称");
         validateFieldForStandard(request.getExecOrgType(), plan.getExecOrgType(), "当前状态仅允许修改任务名称");
-        List<Long> execOrgIdList = coreDrillPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
-        validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), "当前状态仅允许修改任务名称");
+      /*  List<Long> execOrgIdList = coreDrillPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
+        validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), "当前状态仅允许修改任务名称");*/
         validateFieldForStandard(request.getRemark(), plan.getRemark(), "当前状态仅允许修改任务名称");
         validateFileListForStandard(request.getFileList(), JSON.parseArray(plan.getFileList(), String.class), "当前状态仅允许修改任务名称");
         plan.setPlanName(request.getPlanName());
+        List<Long> list = baseMapper.selectIdByParentId(plan.getId());
+        if (ObjectUtil.isEmpty(list)){
+            return;
+        }
+        physicalDeleteMapper.deletedDrillPlanByIds(list);
+        coreDrillPlanToExecOrgService.deleteByPlanIds(list);
+
+
+        coreDrillPlanToExecOrgMapper.deleteByMap(MapUtil.of("plan_id", plan.getId()));
+        batchSavePlanToExecOrg(request.getPlanExecOrgIdList(), plan.getId());
+
         updateById(plan);
 
     }
@@ -414,7 +421,7 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
         List<Long> longs = baseMapper.selectAllIdByParentId(plan.getId());
         if (!longs.isEmpty()) {
             baseMapper.delByIds(longs);
-            coreDrillPlanToExecOrgService.deleteByParentId(longs);
+            coreDrillPlanToExecOrgService.deleteByPlanIds(longs);
         }
 
 
@@ -423,58 +430,6 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
         coreDrillPlanMapper.updateById(plan);
     }
 
-    private void updateStandardPlan(CoreDrillPlan plan, CoreDrillPlanUpdateDto request, DateRange range) {
-
-        //使用中的标准计划
-
-        Long planId = plan.getId();
-        // 判断标准计划能否修改:存在下发的计划生成了任务且任务存在已执行
-        Integer standardPlanHasDone = coreDrillTaskMapper.checkHasTaskIsDoneByPlanParentId(planId);
-        if (ObjectUtil.equal(standardPlanHasDone, 1)) {
-            SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    orgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-            //验证修改的字段是否符合要求
-            String errorMsg = "有任务已执行或已过期,仅允许修改任务名称!";
-            validatePlanForStandard(request, plan, errorMsg, sysOrg.getType());
-            doUpdatePlan(plan, request);
-            coreDrillPlanMapper.updatePlanName(plan.getId(), plan.getPlanName());
-            coreDrillTaskMapper.updateTaskNameByParentPlanId(planId, plan.getPlanName(), range.getStartTime(), range.getEndTime());
-        } else {
-            doUpdatePlan(plan, request);
-            delAllByParentPlanId(plan);
-            List<CoreDrillPlan> planList = null;
-            if (plan.getIssue() == 1) {
-                planList = buildPlanData(plan, null, false, 0);
-            } else {
-                planList = ListUtil.list(true, plan);
-            }
-/*            if (checkOrgType(plan.getExecOrgType())) {
-                planList.add(plan);
-            }*/
-            List<CoreDrillPlan> finalPlanList = planList;
-            TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
-                @Override
-                public void afterCommit() {
-                    for (CoreDrillPlan drillPlan : finalPlanList) {
-                        CompletableFuture.runAsync(() -> {
-                            //如果不是省联社或者办事处,状态启用,并且是无周期或者立即生效
-                            if (checkCanBuildTaskNow(plan)) {
-                                CoreDrillPlanDataVo detailPlanData = getCoreDrillPlanDataVo(drillPlan.getId());
-                                coreDrillTaskService.createTaskForNow(detailPlanData, plan.getPlanStartDate(), plan.getPlanEndDate());
-                            }
-                        }, threadPoolTaskExecutor);
-                    }
-                }
-            });
-
-
-        }
-
-        //TODO 修改任务名称
-        //coreEduTrainingTaskMapper.updateTaskNameByPlanId(planId, planName, plan.getStartDate(), plan.getEndDate());
-
-    }
-
     @Override
     public void populateProperties(CoreDrillPlan source, CoreDrillPlan target) {
         target.setPlanName(source.getPlanName());
@@ -488,119 +443,6 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
         target.setRemark(source.getRemark());
         target.setFileList(source.getFileList());
     }
-
-    private void deletePlanAndTaskByParentPlanId(Long planId) {
-        //删除原有数据, 然后重新生成计划,任务
-        List<Long> planIdList = coreDrillPlanMapper.selectAllIdByParentId(planId);
-        if (ObjectUtil.isEmpty(planIdList)) {
-            return;
-        }
-        if (ObjectUtil.isNotEmpty(planIdList)) {
-            coreDrillPlanMapper.deleteBatchIds(planIdList);
-            coreDrillPlanToExecOrgMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToExecOrg>().in(CoreDrillPlanToExecOrg::getPlanId, planIdList));
-            coreDrillPlanToRoleMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToRole>().in(CoreDrillPlanToRole::getPlanId, planIdList));
-        }
-        List<CoreDrillTask> taskIdList = coreDrillTaskMapper.selectList(new LambdaQueryWrapper<CoreDrillTask>().in(CoreDrillTask::getPlanId, planIdList).select(CoreDrillTask::getId));
-        List<Long> collect = taskIdList.stream().map(CoreDrillTask::getId).collect(toList());
-        if (ObjectUtil.isNotEmpty(collect)) {
-            coreDrillTaskMapper.deleteBatchIds(collect);
-            coreDrillTaskToRoleMapper.delete(new LambdaQueryWrapper<CoreDrillTaskToRole>().in(CoreDrillTaskToRole::getDrillTaskId, collect));
-
-        }
-    }
-
-    private void updateCommonPlan(CoreDrillPlan plan, CoreDrillPlanUpdateDto request, DateRange range) {
-        CoreDrillPlan parentPlan = coreDrillPlanMapper.selectOne(new LambdaQueryWrapper<CoreDrillPlan>()
-                .eq(CoreDrillPlan::getId, plan.getParentId()));
-        //使用中的普通计划
-        if (parentPlan.getExecTimes() > request.getExecTimes()) {
-            throw new RuntimeException("执行次数不能小于基准计划执行次数!");
-        }
-        if (ObjectUtil.notEqual(plan.getId(), plan.getParentId())) {
-            String errorMsg = null;
-            SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    orgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-            if (ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.SHEGN_LIAN_SHE.getCode())) {
-                errorMsg = "当前用户身份仅允许修改子任务的任务名称和任务次数!!";
-            } else {
-                errorMsg = "当前用户身份仅允许修改子任务的任务次数!";
-            }
-            validatePlanForStandard(request, parentPlan, errorMsg, sysOrg.getType());
-        }
-        doUpdatePlan(plan, request);
-        final long done = coreDrillTaskMapper.selectCount(new LambdaQueryWrapper<CoreDrillTask>()
-                .eq(CoreDrillTask::getPlanId, plan.getId())
-                .ge(CoreDrillTask::getStartDate, range.getStartTime())
-                .le(CoreDrillTask::getEndDate, range.getEndTime())
-                .in(CoreDrillTask::getStatus, DrillDoStatus.DONE.getCode(), DrillDoStatus.OVERDUE.getCode()));
-        //如果有一条状态不等于待培训的数据,那么就下个周期生效
-        if (done > 0) {
-            //任务已执行,下个周期生效
-            return;
-        }
-        //如果没有,那就删除这个计划当前周期的所有任务,重新生成
-        coreDrillTaskService.delByStartTimeAndEndTimeAndPlanIdList(Arrays.asList(plan.getId()), range.getStartTime(), range.getEndTime());
-        TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
-            @Override
-            public void afterCommit() {
-                CompletableFuture.runAsync(() -> {
-                    //如果不是省联社或者办事处,状态启用,并且是无周期或者立即生效
-                    if (checkCanBuildTaskNow(plan)) {
-                        final CoreDrillPlanDataVo detailPlanData = getCoreDrillPlanDataVo(plan.getId());
-                        coreDrillTaskService.createTaskForNow(detailPlanData, plan.getPlanStartDate(), plan.getPlanEndDate());
-                    }
-                }, threadPoolTaskExecutor);
-            }
-        });
-    }
-
-
-    private void delAllByParentPlanId(CoreDrillPlan plan) {
-        List<Long> planIdList = coreDrillPlanMapper.selectIdByParentId(plan.getId());
-        if (ObjectUtil.isEmpty(planIdList)) {
-            return;
-        }
-        if (plan.getId().equals(plan.getParentId())) {
-            List<Long> list = new ArrayList<>(planIdList);
-            list.remove(plan.getId());
-            if (list.isEmpty()) {
-                return;
-            }
-            coreDrillPlanMapper.deleteBatchIds(planIdList);
-            coreDrillPlanToRoleMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToRole>()
-                    .in(CoreDrillPlanToRole::getPlanId, planIdList));
-            coreDrillPlanToExecOrgMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToExecOrg>()
-                    .in(CoreDrillPlanToExecOrg::getPlanId, planIdList));
-        }
-        coreDrillPlanToRoleMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToRole>()
-                .in(CoreDrillPlanToRole::getPlanId, planIdList));
-        coreDrillPlanToExecOrgMapper.delete(new LambdaQueryWrapper<CoreDrillPlanToExecOrg>()
-                .in(CoreDrillPlanToExecOrg::getPlanId, planIdList));
-
-        coreDrillTaskService.delByStartTimeAndEndTimeAndPlanIdList(planIdList, null, null);
-
-
-    }
-
-
-    private void validatePlanForStandard(CoreDrillPlanUpdateDto request, CoreDrillPlan plan, String errorMsg, Integer type) {
-        validateFieldForStandard(request.getPlanCycle(), plan.getPlanCycle(), errorMsg);
-        validateFieldForStandard(request.getExecOrgType(), plan.getExecOrgType(), errorMsg);
-        List<Long> execOrgIdList = coreDrillPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
-        validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), errorMsg);
-        validateFieldForStandard(request.getRemark(), plan.getRemark(), errorMsg);
-        validateFileListForStandard(request.getFileList(), JSON.parseArray(plan.getFileList(), String.class), errorMsg);
-        if (plan.getPlanCycle().equals(EduTrainingPlanCycleEnum.NONE.getCode())) {
-            validateFieldForStandard(request.getStartDate(), plan.getPlanStartDate(), errorMsg);
-            validateFieldForStandard(request.getEndDate(), plan.getPlanEndDate(), errorMsg);
-        }
-        if (OrgTypeEnum.HANG_SHE.equals(OrgTypeEnum.getOrgTypeEnum(type))) {
-            //标准计划可以修改名称,行社不允许修改名称
-            validateFieldForStandard(request.getPlanName(), plan.getPlanName(), errorMsg);
-        }
-
-    }
-
     private void validateFieldForStandard(Object requestValue, Object planValue, String errorMessage) {
         if (ObjectUtils.allNull(requestValue, planValue)) {
             return;
@@ -632,18 +474,6 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
 
     }
 
-    public void batchSavePlanToRole(List<Long> roleIdList, Long planId) {
-        List<CoreDrillPlanToRole> planRoleList = new ArrayList<>();
-        for (Long roleId : roleIdList) {
-            CoreDrillPlanToRole role = new CoreDrillPlanToRole();
-            role.setRoleId(roleId);
-            role.setPlanId(planId);
-            planRoleList.add(role);
-        }
-        if (CollectionUtil.isNotEmpty(planRoleList)) {
-            coreDrillPlanToRoleService.saveBatch(planRoleList);
-        }
-    }
 
     public void batchSavePlanToExecOrg(List<Long> orgIdList, Long planId) {
 
@@ -796,17 +626,6 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
         }
     }
 
-    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());
-    }
-
     private void checkPlanIsCreatingTask(Long planId, String msg) {
         String redisKey = "Drill_Creating_Task" + planId;
         Boolean hasKey = RedisUtils.hasKey(redisKey);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanToExecOrgServiceImpl.java

@@ -111,7 +111,7 @@ public class CoreDrillPlanToExecOrgServiceImpl extends ServiceImpl<CoreDrillPlan
 
 
     @Override
-    public int deleteByParentId(List<Long> planIds) {
+    public int deleteByPlanIds(List<Long> planIds) {
         if (planIds == null || planIds.isEmpty()) {
             return 0;
         }

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -221,8 +221,8 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         record.setTypeText(DictUtils.getDictLabel(DictConstants.CORE_DRILL_TYPE, record.getType()));
         //处理演练任务推荐状态字典
         record.setRecStatusText(DictUtils.getDictLabel(DictConstants.DRILL_TASK_REC_STATUS, record.getRecStatus()));
-        if (SecurityUtils.isApp()){
-            record.setOrgName(orgService.concatOrgName(record.getOrgId(),SecurityConstants.INNER));
+        if (SecurityUtils.isApp()) {
+            record.setOrgName(orgService.concatOrgName(record.getOrgId(), SecurityConstants.INNER));
         }
     }
 
@@ -1006,7 +1006,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
                 //处理演练任务推荐状态字典
                 record.setRecStatusText(DictUtils.getDictLabel(DictConstants.DRILL_TASK_REC_STATUS, record.getRecStatus()));
             }
-            record.setOrgName(orgService.concatOrgName(record.getOrgId(),SecurityConstants.INNER));
+            record.setOrgName(orgService.concatOrgName(record.getOrgId(), SecurityConstants.INNER));
             record.setNoBscArea(isNoBSCAreaSubOrg(record.getOrgPath(),ObjectUtil.isNotNull(noBscAreaConfig)?noBscAreaConfig.getConfigValue():StringUtil.EMPTY_STRING));
 
         }
@@ -1051,7 +1051,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         for (CoreDrillTaskRecTaskPageVo record : records) {
             //处理演练任务类型字典
             record.setTypeText(DictUtils.getDictLabel(DictConstants.CORE_DRILL_TYPE, record.getType()));
-            record.setOrgName(orgService.concatOrgName(record.getOrgId(),SecurityConstants.INNER));
+            record.setOrgName(orgService.concatOrgName(record.getOrgId(), SecurityConstants.INNER));
         }
         return TableDataInfo.build(page);
     }

+ 17 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/mapper/PhysicalDeleteMapper.java

@@ -0,0 +1,17 @@
+package com.xunmei.core.edu.mapper;
+
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface PhysicalDeleteMapper {
+
+
+    //物理删除
+    void deletedEduPlanByIds(@Param("list") List<Long> list);
+
+    void deletedDrillPlanByIds(@Param("list") List<Long> list);
+}

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/ICoreEduTrainingPlanToExecOrgService.java

@@ -10,5 +10,5 @@ import java.util.List;
  * @date 2023/8/25 14:30
  */
 public interface ICoreEduTrainingPlanToExecOrgService extends IService<CoreEduTrainingPlanToExecOrg> {
-    int deleteByParentId(List<Long> planIds);
+    int deleteByPlanIds(List<Long> planIds);
 }

+ 20 - 169
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanServiceImpl.java

@@ -1,7 +1,6 @@
 package com.xunmei.core.edu.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -19,6 +18,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.compensate.dto.CompensateDto;
 import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingPlan;
 import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingPlanToExecOrg;
 import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingPlanToRole;
@@ -48,13 +48,9 @@ import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.redis.utils.RedisUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
-import com.xunmei.common.core.domain.compensate.dto.CompensateDto;
 import com.xunmei.core.compense.interfaces.CompensateService;
 import com.xunmei.core.compense.service.ICoreCompensateLogService;
-import com.xunmei.core.edu.mapper.CoreEduTrainingPlanMapper;
-import com.xunmei.core.edu.mapper.CoreEduTrainingPlanToExecOrgMapper;
-import com.xunmei.core.edu.mapper.CoreEduTrainingPlanToRoleMapper;
-import com.xunmei.core.edu.mapper.CoreEduTrainingTaskMapper;
+import com.xunmei.core.edu.mapper.*;
 import com.xunmei.core.edu.service.ICoreEduTrainingPlanService;
 import com.xunmei.core.edu.service.ICoreEduTrainingPlanToExecOrgService;
 import com.xunmei.core.edu.service.ICoreEduTrainingPlanToRoleService;
@@ -78,8 +74,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.support.TransactionSynchronizationAdapter;
-import org.springframework.transaction.support.TransactionSynchronizationManager;
 
 import java.time.Duration;
 import java.util.*;
@@ -112,6 +106,8 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
     private ICoreEduTrainingTaskService coreEduTrainingTaskService;
     @Autowired
     private CoreEduTrainingTaskMapper coreEduTrainingTaskMapper;
+    @Autowired
+    private PhysicalDeleteMapper physicalDeleteMapper;
 
     @Autowired
     private RemoteOrgService orgService;
@@ -403,63 +399,26 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
         validateFieldForStandard(request.getPlanCycle(), plan.getPlanCycle(), "当前状态仅允许修改任务名称");
         validateFieldForStandard(request.getExecTimes(), plan.getExecTimes(), "当前状态仅允许修改任务名称");
         validateFieldForStandard(request.getExecOrgType(), plan.getExecOrgType(), "当前状态仅允许修改任务名称");
-        List<Long> execOrgIdList = coreEduTrainingPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
-        validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), "当前状态仅允许修改任务名称");
+        /*List<Long> execOrgIdList = coreEduTrainingPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
+        //validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), "当前状态仅允许修改任务名称");*/
         validateFieldForStandard(request.getRemark(), plan.getRemark(), "当前状态仅允许修改任务名称");
         validateFileListForStandard(request.getFileList(), JSON.parseArray(plan.getFileList(), String.class), "当前状态仅允许修改任务名称");
         plan.setPlanName(request.getPlanName());
-        updateById(plan);
+        List<Long> list = baseMapper.selectIdByParentId(plan.getId());
+        if (ObjectUtil.isEmpty(list)){
+            return;
+        }
+        physicalDeleteMapper.deletedEduPlanByIds(list);
+        coreEduTrainingPlanToExecOrgService.deleteByPlanIds(list);
 
-    }
 
-    private void updateCommonPlan(CoreEduTrainingPlan plan, CoreEduTrainingPlanEditDto request, DateRange range) {
-        CoreEduTrainingPlan parentPlan = coreEduTrainingPlanMapper.selectOne(new LambdaQueryWrapper<CoreEduTrainingPlan>()
-                .eq(CoreEduTrainingPlan::getId, plan.getParentId())
-                .select(CoreEduTrainingPlan::getExecTimes));
-        //使用中的普通计划
-        if (parentPlan.getExecTimes() > request.getExecTimes()) {
-            throw new RuntimeException("执行次数不能小于基准计划执行次数!");
-        }
+        coreEduTrainingPlanToExecOrgMapper.deleteByMap(MapUtil.of("plan_id", plan.getId()));
+        batchSavePlanToExecOrg(request.getPlanExecOrgIdList(), plan.getId());
 
-        if (ObjectUtil.notEqual(plan.getId(), plan.getParentId())) {
-            String errorMsg = null;
-            SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    orgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-            if (ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.SHEGN_LIAN_SHE.getCode())) {
-                errorMsg = "当前用户身份仅允许修改子计划的培训主题和培训次数!!";
-            } else {
-                errorMsg = "当前用户身份仅允许修改子计划的培训次数!";
-            }
-            validatePlanForStandard(request, plan, errorMsg, sysOrg.getType());
-        }
-        doUpdatePlan(plan, request);
-
-        final long done = coreEduTrainingTaskMapper.selectCount(new LambdaQueryWrapper<CoreEduTrainingTask>()
-                .eq(CoreEduTrainingTask::getPlanId, plan.getId())
-                .ge(CoreEduTrainingTask::getStartDate, range.getStartTime())
-                .le(CoreEduTrainingTask::getEndDate, range.getEndTime())
-                .in(CoreEduTrainingTask::getStatus, EduTrainingDoStatus.DONE.getCode(), EduTrainingDoStatus.OVERDUE.getCode()));
-        //如果有一条状态等于已完成/已逾期的数据,那么就下个周期生效
-        if (done > 0) {
-            //任务已执行,下个周期生效
-            return;
-        }
-        //如果没有,那就删除这个计划当前周期的所有任务,重新生成
-        coreEduTrainingTaskService.delByStartTimeAndEndTimeAndPlanIdList(Arrays.asList(plan.getId()), range.getStartTime(), range.getEndTime());
-        TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
-            @Override
-            public void afterCommit() {
-                CompletableFuture.runAsync(() -> {
-                    //如果不是省联社或者办事处,状态启用,并且是无周期或者立即生效
-                    if (checkCanBuildTaskNow(plan)) {
-                        CoreEduTrainingPlanDataVo detailPlanData = getCoreEduTrainingPlanDataVo(plan.getId());
-                        coreEduTrainingTaskService.createTaskForNow(detailPlanData, plan.getStartDate(), plan.getEndDate());
-                    }
-                }, threadPoolTaskExecutor);
-            }
-        });
+        updateById(plan);
     }
 
+
     private void doUpdatePlan(CoreEduTrainingPlan plan, CoreEduTrainingPlanEditDto request) {
         BeanUtils.copyProperties(request, plan);
         if (ObjectUtil.equal(request.getPlanCycle(), DrillPlanCycleEnum.NONE.getCode())) {
@@ -475,7 +434,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
         List<Long> longs = baseMapper.selectAllIdByParentId(plan.getId());
         if (!longs.isEmpty()) {
             baseMapper.delByIds(longs);
-            coreEduTrainingPlanToExecOrgService.deleteByParentId(longs);
+            coreEduTrainingPlanToExecOrgService.deleteByPlanIds(longs);
         }
 
 
@@ -484,114 +443,6 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
         coreEduTrainingPlanMapper.updateById(plan);
     }
 
-    private void updateStandardPlan(CoreEduTrainingPlan plan, CoreEduTrainingPlanEditDto request, DateRange range) {
-
-        //使用中的标准计划
-
-        Long planId = plan.getId();
-        // 判断标准计划能否修改:存在下发的计划生成了任务且任务存在已执行
-        Integer standardPlanHasDone = coreEduTrainingTaskMapper.checkHasTaskIsDoneByPlanParentId(planId);
-        if (ObjectUtil.equal(standardPlanHasDone, 1)) {
-            SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    orgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-            //验证修改的字段是否符合要求
-            String errorMsg = "有任务已执行或已过期,仅允许修改培训主题!";
-            validatePlanForStandard(request, plan, errorMsg, sysOrg.getType());
-            doUpdatePlan(plan, request);
-            coreEduTrainingPlanMapper.updatePlanName(plan.getId(), plan.getPlanName());
-            coreEduTrainingTaskMapper.updateTaskNameByParentPlanId(planId, plan.getPlanName(), range.getStartTime(), range.getEndTime());
-        } else {
-            doUpdatePlan(plan, request);
-            delAllByParentPlanId(plan);
-
-            List<CoreEduTrainingPlan> planList = null;
-            if (plan.getIssue() == 1) {
-                planList = buildPlanData(plan, null, false, 0);
-            } else {
-                planList = ListUtil.list(true, plan);
-            }
-            //List<CoreEduTrainingPlan> planList = buildPlanData(plan, null, false);
-            List<CoreEduTrainingPlan> finalPlanList = planList;
-            TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
-                @Override
-                public void afterCommit() {
-                    for (CoreEduTrainingPlan trainingPlan : finalPlanList) {
-                        CompletableFuture.runAsync(() -> {
-                            //如果不是省联社或者办事处,状态启用,并且是无周期或者立即生效
-                            if (checkCanBuildTaskNow(plan)) {
-                                CoreEduTrainingPlanDataVo detailPlanData = getCoreEduTrainingPlanDataVo(trainingPlan.getId());
-                                coreEduTrainingTaskService.createTaskForNow(detailPlanData, plan.getStartDate(), plan.getEndDate());
-                            }
-                        }, threadPoolTaskExecutor);
-                    }
-                }
-            });
-
-        }
-
-        //TODO 修改任务名称
-        //coreEduTrainingTaskMapper.updateTaskNameByPlanId(planId, planName, plan.getStartDate(), plan.getEndDate());
-
-    }
-
-    private void delAllByParentPlanId(CoreEduTrainingPlan plan) {
-        List<Long> planIdList = coreEduTrainingPlanMapper.selectIdByParentId(plan.getId());
-        if (ObjectUtil.isEmpty(planIdList)) {
-            return;
-        }
-        // 下发给省联社/办事处/行社的计划 在下发时会把id设置为parentId,所以这里不需要删除
-        if (plan.getId().equals(plan.getParentId())) {
-            List<Long> list = new ArrayList<>(planIdList);
-            list.remove(plan.getId());
-            if (list.isEmpty()) {
-                return;
-            }
-            coreEduTrainingPlanMapper.deleteBatchIds(list);
-
-            coreEduTrainingPlanToRoleMapper.delete(new LambdaQueryWrapper<CoreEduTrainingPlanToRole>()
-                    .in(CoreEduTrainingPlanToRole::getPlanId, list));
-            coreEduTrainingPlanToExecOrgMapper.delete(new LambdaQueryWrapper<CoreEduTrainingPlanToExecOrg>()
-                    .in(CoreEduTrainingPlanToExecOrg::getPlanId, list));
-        }
-
-        coreEduTrainingPlanToRoleMapper.delete(new LambdaQueryWrapper<CoreEduTrainingPlanToRole>()
-                .in(CoreEduTrainingPlanToRole::getPlanId, planIdList));
-        coreEduTrainingPlanToExecOrgMapper.delete(new LambdaQueryWrapper<CoreEduTrainingPlanToExecOrg>()
-                .in(CoreEduTrainingPlanToExecOrg::getPlanId, planIdList));
-
-        coreEduTrainingTaskService.delByStartTimeAndEndTimeAndPlanIdList(planIdList, null, null);
-    }
-
-    private void populateProperties(CoreEduTrainingPlan source, CoreEduTrainingPlan target) {
-        target.setPlanName(source.getPlanName());
-        target.setPlanCycle(source.getPlanCycle());
-        target.setExecTimes(source.getExecTimes());
-        target.setPlanStatus(source.getPlanStatus());
-        target.setExecOrgType(source.getExecOrgType());
-        target.setStartDate(source.getStartDate());
-        target.setEndDate(source.getEndDate());
-        target.setBuildTaskNow(source.getBuildTaskNow());
-        target.setRemark(source.getRemark());
-        target.setFileList(source.getFileList());
-
-    }
-
-    private void validatePlanForStandard(CoreEduTrainingPlanEditDto request, CoreEduTrainingPlan plan, String errorMsg, Integer type) {
-        validateFieldForStandard(request.getPlanCycle(), plan.getPlanCycle(), errorMsg);
-        validateFieldForStandard(request.getExecOrgType(), plan.getExecOrgType(), errorMsg);
-        List<Long> execOrgIdList = coreEduTrainingPlanToExecOrgMapper.selectOrgIdByPlanId(plan.getId());
-        validateListForStandard(execOrgIdList, request.getPlanExecOrgIdList(), errorMsg);
-        validateFieldForStandard(request.getRemark(), plan.getRemark(), errorMsg);
-        validateFileListForStandard(request.getFileList(), JSON.parseArray(plan.getFileList(), String.class), errorMsg);
-
-        if (OrgTypeEnum.HANG_SHE.equals(OrgTypeEnum.getOrgTypeEnum(type))) {
-            //标准计划可以修改名称,行社不允许修改名称
-            validateFieldForStandard(request.getPlanName(), plan.getPlanName(), errorMsg);
-        }
-
-
-    }
-
     private void validateFileListForStandard(List<String> requestFileList, List<String> sourceFileList, String errorMsg) {
         if (ObjectUtil.isEmpty(requestFileList) && ObjectUtil.isEmpty(sourceFileList)) {
             return;
@@ -773,7 +624,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
 
             List<CoreEduTrainingPlan> planList = baseMapper.selectByParentId(planId);
             if (planList.isEmpty()) {
-                planList = buildPlanData(plan, new ArrayList<>(), true, status);
+                planList = buildPlanData(plan, true, status);
             } else {
                 for (CoreEduTrainingPlan trainingPlan : planList) {
                     trainingPlan.setPlanStatus(EduTrainingPlanStatus.USING.getCode());
@@ -836,7 +687,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
         return collect;
     }
 
-    private List<CoreEduTrainingPlan> buildPlanData(CoreEduTrainingPlan plan, List<CoreEduTrainingPlanToRole> planRoleList, Boolean isPublish, int status) {
+    private List<CoreEduTrainingPlan> buildPlanData(CoreEduTrainingPlan plan, Boolean isPublish, int status) {
         /*if (ObjectUtil.isEmpty(planRoleList)) {
             //获取执行角色
             LambdaQueryWrapper<CoreEduTrainingPlanToRole> ros = new LambdaQueryWrapper<>();
@@ -913,7 +764,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
         if (insertPlanRoleList.size() > 0) {
             coreEduTrainingPlanToRoleService.saveBatch(insertPlanRoleList);
         }*/
-        if (list.size() > 0) {
+        if (!list.isEmpty()) {
             this.saveBatch(list);
         }
 

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanToExecOrgServiceImpl.java

@@ -16,7 +16,7 @@ import java.util.List;
 @Service
 public class CoreEduTrainingPlanToExecOrgServiceImpl extends ServiceImpl<CoreEduTrainingPlanToExecOrgMapper, CoreEduTrainingPlanToExecOrg> implements ICoreEduTrainingPlanToExecOrgService {
     @Override
-    public int deleteByParentId(List<Long> planIds) {
+    public int deleteByPlanIds(List<Long> planIds) {
         if (planIds == null || planIds.isEmpty()) {
             return 0;
         }

+ 25 - 32
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java

@@ -213,8 +213,8 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         int totalNums = (int) userList.stream().filter(user -> ObjectUtil.equal(user.getType(), 1)).count();
         record.setSignNums(signNums + "/" + totalNums);
         record.setUserList(userList);
-        if (SecurityUtils.isApp()){
-            record.setOrgName(orgService.concatOrgName(record.getOrgId(),SecurityConstants.INNER));
+        if (SecurityUtils.isApp()) {
+            record.setOrgName(orgService.concatOrgName(record.getOrgId(), SecurityConstants.INNER));
         }
 
     }
@@ -247,8 +247,8 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             detailVo.setAbsenceList(collect.get(1));
             detailVo.setAbsentList(collect.get(2));
         }
-        if (SecurityUtils.isApp()){
-            detailVo.setOrgName(orgService.concatOrgName(detailVo.getOrgId(),SecurityConstants.INNER));
+        if (SecurityUtils.isApp()) {
+            detailVo.setOrgName(orgService.concatOrgName(detailVo.getOrgId(), SecurityConstants.INNER));
         }
         return detailVo;
     }
@@ -304,7 +304,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             }
             coreEduTrainingTaskToUserService.saveBatch(taskUserList);
         }
-        dealHost(request.getHostName(),task);
+        dealHost(request.getHostName(), task);
         task.setRecorderId(SecurityUtils.getUserId());
         task.setStatus(EduTrainingDoStatus.WAIT_SIGN.getCode());
         return coreEduTrainingTaskMapper.insert(task);
@@ -359,7 +359,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         } else {
             coreEduTrainingTask.setFileList(null);
         }
-        dealHost(request.getHostName(),coreEduTrainingTask);
+        dealHost(request.getHostName(), coreEduTrainingTask);
         coreEduTrainingTaskToUserMapper.deleteByMap(MapUtil.of("edu_training_task_id", request.getId()));
         List<CoreEduTrainingTaskToUser> taskUserList = request.getTaskUserList();
         if (ObjectUtil.isNotEmpty(taskUserList)) {
@@ -372,12 +372,12 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         }
         // 暂存: 待提交    提交:待签名
         if (ObjectUtil.equal(request.getSubmitType(), 1)) {
-            if (ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_SUBMIT.getCode())&&ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_RECORDED.getCode())){
+            if (ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_SUBMIT.getCode()) && ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_RECORDED.getCode())) {
                 throw new SystemException("当前状态不允许修改,请退出当前页面后刷新重试!");
             }
             coreEduTrainingTask.setStatus(EduTrainingDoStatus.WAIT_SUBMIT.getCode());
         } else {
-            if (ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_SUBMIT.getCode())&&ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_RECORDED.getCode())){
+            if (ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_SUBMIT.getCode()) && ObjectUtil.notEqual(coreEduTrainingTask.getStatus(), EduTrainingDoStatus.WAIT_RECORDED.getCode())) {
                 throw new SystemException("当前状态不允许修改,请退出当前页面后刷新重试!");
             }
             coreEduTrainingTask.setStatus(EduTrainingDoStatus.WAIT_SIGN.getCode());
@@ -394,7 +394,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
     }
 
     private void dealHost(String hostName, CoreEduTrainingTask task) {
-        if (ObjectUtil.isNotEmpty(hostName)){
+        if (ObjectUtil.isNotEmpty(hostName)) {
             task.setHostName(hostName);
             return;
         }
@@ -561,8 +561,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         final Map<Long, List<SysWorkTime>> listMap = workTimeList.stream().filter(time -> ObjectUtil.equal(time.getIsEnable(), 1L)).collect(Collectors.groupingBy(SysWorkTime::getOrgId));
 
         for (SysOrg org : orgList) {
-            if(org.getIsLock().equals(1)|| org.getDeleted().equals(1))
-            {
+            if (org.getIsLock().equals(1) || org.getDeleted().equals(1)) {
                 continue;
             }
             Map<Short, DateRange> rangeMap;
@@ -656,13 +655,13 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             task.setNo(list.indexOf(task) + 1);
         }
         try {
-            String baseHeaderName="教育培训情况表";
+            String baseHeaderName = "教育培训情况表";
             // 设置响应头
             response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(baseHeaderName, "utf-8"));
             response.setContentType("application/octet-stream;charset=UTF-8");
             response.setCharacterEncoding("utf-8");
 
-            String header=baseHeaderName+"("+DateUtil.format( request.getStartTime(),"yyyy-MM")+"至"+ DateUtil.format( request.getEndTime(),"yyyy-MM") +")";
+            String header = baseHeaderName + "(" + DateUtil.format(request.getStartTime(), "yyyy-MM") + "至" + DateUtil.format(request.getEndTime(), "yyyy-MM") + ")";
             // 数据导出
             EasyExcel.write(response.getOutputStream(), CoreEduTrainingTaskReportVo.class)
                     .registerWriteHandler(new ValueCellWriteHandler(header)).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet(baseHeaderName).doWrite(list);
@@ -690,10 +689,10 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         if (ObjectUtil.isAllEmpty(planId, planIdList)) {
             return new ArrayList<>();
         }
-        if (ObjectUtil.equal(request.getSourceType(),1)){
+        if (ObjectUtil.equal(request.getSourceType(), 1)) {
             request.setStartTime(DateUtil.beginOfMonth(request.getMonthDate().get(0)));
             request.setEndTime(DateUtil.endOfMonth(request.getMonthDate().get(1)));
-        }else {
+        } else {
             request.setStartTime(DateUtil.beginOfMonth(request.getDate()));
             request.setEndTime(DateUtil.endOfMonth(request.getDate()));
         }
@@ -703,7 +702,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         request.setOrgPath(sysOrg.getPath());
 
         List<SysOrg> sysOrgList;
-        if (null==sysOrg.getType()){
+        if (null == sysOrg.getType()) {
             return Collections.emptyList();
         }
         if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社")) {
@@ -721,28 +720,25 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         List<CoreEduTrainingTaskReportVo> result = new ArrayList<>();
         List<CoreEduTrainingTaskReportVo> list = coreEduTrainingTaskMapper.selectReport(request, planId, planIdList);
 
-        return buildResultData(sysOrgList, result, list,sysOrg);
+        return buildResultData(sysOrgList, result, list, sysOrg);
     }
 
-    private List<CoreEduTrainingTaskReportVo> buildResultData(List<SysOrg> sysOrgList, List<CoreEduTrainingTaskReportVo> result, List<CoreEduTrainingTaskReportVo> list,SysOrg sysOrg) {
+    private List<CoreEduTrainingTaskReportVo> buildResultData(List<SysOrg> sysOrgList, List<CoreEduTrainingTaskReportVo> result, List<CoreEduTrainingTaskReportVo> list, SysOrg sysOrg) {
         if (list.isEmpty()) {
             //buildEmptyData(sysOrgList, result);
             return result;
         }
         for (SysOrg org : sysOrgList) {
-            if(ObjectUtil.equal(sysOrg.getType(),OrgTypeEnum.HANG_SHE.getCode()) && !ObjectUtil.equal(org.getType(),OrgTypeEnum.YINGYE_WANGDIAN.getCode()))
-            {
+            if (ObjectUtil.equal(sysOrg.getType(), OrgTypeEnum.HANG_SHE.getCode()) && !ObjectUtil.equal(org.getType(), OrgTypeEnum.YINGYE_WANGDIAN.getCode())) {
                 continue;
             }
-            List<CoreEduTrainingTaskReportVo> childrenOrgData=new ArrayList<>();
-            if(ObjectUtil.equal(org.getType(),OrgTypeEnum.YINGYE_WANGDIAN.getCode()))
-            {
+            List<CoreEduTrainingTaskReportVo> childrenOrgData = new ArrayList<>();
+            if (ObjectUtil.equal(org.getType(), OrgTypeEnum.YINGYE_WANGDIAN.getCode())) {
                 childrenOrgData = list.stream()
                         //.filter(vo -> vo.getOrgPath().startsWith(org.getPath()))
                         .filter(vo -> vo.getOrgId().equals(org.getId()))
                         .collect(Collectors.toList());
-            }
-            else {
+            } else {
                 childrenOrgData = list.stream()
                         .filter(vo -> vo.getOrgPath().startsWith(org.getPath()))
                         //.filter(vo -> vo.getOrgId().equals(org.getId()))
@@ -829,7 +825,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
     public AjaxResult buildEduPdf(Long id) {
         CoreEduTrainingTaskDetailVo task = this.selectCoreEduTrainingTaskById(id);
         SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(task.getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.EDUCATION_TRAINING,sysOrg);
+        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.EDUCATION_TRAINING, sysOrg);
         Map<String, Object> data = this.getFtlEdu(task);
         data.put("fileName", fileName);
         data.put("id", id);
@@ -939,7 +935,6 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         }
 
         List<CoreEduTrainingPlan> planList;
-
         if (null == cycle) {
             List<Integer> cycleList = DateUtils.checkDate(date);
             planList = coreEduTrainingPlanMapper.selectNeedBuildTaskPlanList(null, cycleList);
@@ -1022,11 +1017,9 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         List<PanelListVo> list = coreEduTrainingTaskMapper.selectCurUserTaskList(panelListDto);
         //获取需要登录人 签名的所有任务,解决人员还没签名就调动到其他机构的问题
         List<PanelListVo> loginUserAllNeedSignlist = coreEduTrainingTaskMapper.selectUserAllEduTrainingSignList(panelListDto);
-        if(ObjectUtil.isNotEmpty(loginUserAllNeedSignlist))
-        {
-            loginUserAllNeedSignlist.stream().forEach(x->{
-                if(!list.stream().anyMatch(y->ObjectUtil.equal(y.getId(),x.getId())))
-                {
+        if (ObjectUtil.isNotEmpty(loginUserAllNeedSignlist)) {
+            loginUserAllNeedSignlist.stream().forEach(x -> {
+                if (!list.stream().anyMatch(y -> ObjectUtil.equal(y.getId(), x.getId()))) {
                     list.add(x);
                 }
             });

+ 6 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java

@@ -2,6 +2,7 @@ package com.xunmei.core.reportForms.resumption.controller;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import com.xunmei.common.core.constant.Constants;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.domain.AjaxResult;
@@ -25,7 +26,6 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.time.LocalDate;
-import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
@@ -62,8 +62,8 @@ public class ResumptionReportController {
 
     @ApiOperation(value = "每日安全保卫履职-日报表")
     @RequiresPermissions("core:resumptionReport:list")
-    @GetMapping("/list")
-    public AjaxResult list(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
+    @PostMapping("/list")
+    public AjaxResult list(@RequestBody ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
         if (null == resumptionDTO.getSearchTime()) {
             LocalDate currentDate = LocalDate.now();
             if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
@@ -79,10 +79,11 @@ public class ResumptionReportController {
         AjaxResult ajaxResult = AjaxResult.success();
         List<ResumptionDayVO> report = resumptionReportService.report(resumptionDTO);
         ajaxResult.put(AjaxResult.DATA_TAG, report);
+        DateTime time = DateUtil.parse(resumptionDTO.getSearchTime());
         if (null == resumptionDTO.getCycle() || resumptionDTO.getCycle() == 1) {
-            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + resumptionDTO.getSearchTime() + ")");
+            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.DAILY_FORMAT) + ")");
         } else {
-            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + resumptionDTO.getSearchTime() + ")");
+            ajaxResult.put(TITLE, "营业网点安全保卫履职情况表(" + DateUtil.format(time,Constants.DAILY_FORMAT) + ")");
         }
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
         ajaxResult.put("orgName", sysOrg.getShortName());

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/dto/ResumptionDTO.java

@@ -3,6 +3,7 @@ package com.xunmei.core.reportForms.resumption.dto;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
 import javax.validation.constraints.NotEmpty;
 import java.util.Date;
 import java.util.List;
@@ -15,8 +16,12 @@ import java.util.List;
 public class ResumptionDTO {
     private Long orgId;
 
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ApiModelProperty("查询时间,Web端使用此字段查询")
     private String searchTime;
 
+    @ApiModelProperty(value = "是否App查询,App查询会使用startTime和endTime进行范围查询")
+    private Integer appSelect;
     private Integer planType;
     private Date startTime;
     private Date endTime;

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java

@@ -17,7 +17,8 @@ import java.util.Map;
 @Mapper
 public interface ResumptionReportMapper {
 
-    ResumptionDayVO selectReport(@Param("cycle") Integer cycle, @Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    //ResumptionDayVO selectReport(@Param("cycle") Integer cycle, @Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    ResumptionDayVO selectReport(@Param("req") ResumptionDTO req, @Param("planType") Integer planType,@Param("orgId") Long orgId, @Param("orgPath") String orgPath);
 
     /**
      * 已整改数量

+ 40 - 46
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.reportForms.resumption.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
 import com.xunmei.common.core.constant.SecurityConstants;
@@ -68,6 +69,10 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         } else {
             return Collections.emptyList();
         }
+        if (ObjectUtil.isAllNotEmpty(resumptionDTO.getStartTime(),resumptionDTO.getEndTime())){
+            resumptionDTO.setStartTime(DateUtil.beginOfDay(resumptionDTO.getStartTime()));
+            resumptionDTO.setEndTime(DateUtil.endOfDay(resumptionDTO.getEndTime()));
+        }
         List<ResumptionDayVO> resumptionDayVOS = new ArrayList<>();
 //        sysOrgs.forEach(o -> {
 //            ResumptionDayVO resumptionDayVO = new ResumptionDayVO();
@@ -169,20 +174,20 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         ResumptionDayVO resumptionDayVO1 = null;
         ResumptionDayVO resumptionDayVO2 = null;
         ResumptionDayVO resumptionDayVO3 = null;
-
+        //planType: 1/2/3对应营业前中后
         if (org.getType() != 4) {
             //营业前
-            resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, null, resumptionDTO.getSearchTime(), org.getPath());
+            resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO, 1, null, org.getPath());
             //营业中
-            resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, null, resumptionDTO.getSearchTime(), org.getPath());
+            resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO, 2, null, org.getPath());
             //后
-            resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, null, resumptionDTO.getSearchTime(), org.getPath());
+            resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO, 3, null, org.getPath());
         }
         if (org.getType() == 4) {
             integer = 1;
-            resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, org.getId(), resumptionDTO.getSearchTime(), null);
-            resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, org.getId(), resumptionDTO.getSearchTime(), null);
-            resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, org.getId(), resumptionDTO.getSearchTime(), null);
+            resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO, 1, org.getId(), null);
+            resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO, 2, org.getId(), null);
+            resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO, 3, org.getId(), null);
         }
 
         resumptionDayVO.setNetworkNumber(integer);
@@ -258,7 +263,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException , ExecutionException, InterruptedException, TimeoutException{
+    public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException, ExecutionException, InterruptedException, TimeoutException {
         String orgName = null;
         if (null != resumptionDTO.getOrgId()) {
             SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
@@ -276,9 +281,9 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             intrusionTestReportVO.setOrderNum(i + 1);
         }
         String baseHeaderName = "报警测试情况表";
-        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
-        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
-        String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
+        String startStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getEndTime());
+        String header = baseHeaderName + "(" + startStr + "至" + endStr + ")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
@@ -290,7 +295,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException  {
+    public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
@@ -361,19 +366,17 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         return intrusionTestReportVOList;
     }
 
-    private IntrusionTestReportVO getOneIntrusionTestData(SysOrg o,ResumptionDTO resumptionDTO){
+    private IntrusionTestReportVO getOneIntrusionTestData(SysOrg o, ResumptionDTO resumptionDTO) {
         IntrusionTestReportVO resultVo = new IntrusionTestReportVO();
-        IntrusionTestReportVO tempIntrusionTestReportVO1 =null;
-        Integer networkNumber =null;
-        Map map =null;
+        IntrusionTestReportVO tempIntrusionTestReportVO1 = null;
+        Integer networkNumber = null;
+        Map map = null;
 
-        if(o.getType()==4)
-        {
-            networkNumber =1;
+        if (o.getType() == 4) {
+            networkNumber = 1;
             tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(o.getId(), resumptionDTO, null);
             map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(o.getId(), resumptionDTO, null);
-        }
-        else{
+        } else {
             networkNumber = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO, o.getPath());
             //隐患
@@ -394,7 +397,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException,ExecutionException, InterruptedException, TimeoutException {
+    public void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException, ExecutionException, InterruptedException, TimeoutException {
         String orgName = null;
         if (null != resumptionDTO.getOrgId()) {
             SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
@@ -425,7 +428,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
 
     @Override
-    public List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception,ExecutionException, InterruptedException, TimeoutException {
+    public List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception, ExecutionException, InterruptedException, TimeoutException {
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }
@@ -474,8 +477,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
                     completableFutureList.add(future);
 //                    intrusionTestReportVOList.add(future.get(5, TimeUnit.SECONDS));
                 }
-                if(completableFutureList.size()>0)
-                {
+                if (completableFutureList.size() > 0) {
                     CompletableFuture<Void> allQueries = CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0]));
                     allQueries.get(15L, TimeUnit.SECONDS);
                     completableFutureList.forEach(x -> {
@@ -492,7 +494,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException{
+    public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
 /*        if (null != resumptionDTO.getSearchTime()) {
             String[] split = resumptionDTO.getSearchTime().split("-");
             Integer s = Integer.valueOf(split[1]);
@@ -575,23 +577,21 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         return intrusionTestReportVOList;
     }
 
-    private IntrusionTestReportVO getOneOrgStandByPower(SysOrg o,ResumptionDTO resumptionDTO)
-    {
+    private IntrusionTestReportVO getOneOrgStandByPower(SysOrg o, ResumptionDTO resumptionDTO) {
         IntrusionTestReportVO resultVo = new IntrusionTestReportVO();
-        IntrusionTestReportVO tempIntrusionTestReportVO1 =null;
-        Integer networkNumber =null;
-        Map map =null;
+        IntrusionTestReportVO tempIntrusionTestReportVO1 = null;
+        Integer networkNumber = null;
+        Map map = null;
 
         if (o.getType() == 4) {
             networkNumber = 1;
             map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(o.getId(), resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), null);
             tempIntrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
-        }
-        else{
+        } else {
             networkNumber = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
             tempIntrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             //隐患
-             map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
+            map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
         }
 
         BeanUtils.copyProperties(tempIntrusionTestReportVO1, resultVo);
@@ -604,7 +604,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         resultVo.setNetworkNumber(networkNumber);
         resultVo.setCity(o.getAffiliatedArea());
         resultVo.setOrgName(o.getShortName());
-        return  resultVo;
+        return resultVo;
     }
 
     @Override
@@ -632,22 +632,22 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         }
 
         String baseHeaderName = "离行式自助银行巡检情况表";
-        String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
-        String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
-        String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
+        String startStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getStartTime());
+        String endStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getEndTime());
+        String header = baseHeaderName + "(" + startStr + "至" + endStr + ")";
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding("utf-8");
         String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
         response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
         Class clazz;
-        if (showOrgName){
+        if (showOrgName) {
             List<LhSelfBankInspectionReportNameVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNameVo.class);
             clazz = LhSelfBankInspectionReportNameVo.class;
             // 调用EasyExcel的导出方法
             EasyExcel.write(response.getOutputStream(), clazz)
                     .registerWriteHandler(new ValueCellWriteHandler(header))
                     .sheet(baseHeaderName).doWrite(list);
-        }else {
+        } else {
             List<LhSelfBankInspectionReportNumVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNumVo.class);
             clazz = LhSelfBankInspectionReportNumVo.class;
             // 调用EasyExcel的导出方法
@@ -657,12 +657,6 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
         }
 
 
-
-
-
-
-
-
     }
 
 

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillPlanMapper.xml

@@ -697,7 +697,7 @@
         where p.deleted = 0
         and p.plan_status = 1
         <if test="cycle != null">
-            p.plan_cycle=#{cycle}
+            and p.plan_cycle=#{cycle}
         </if>
         <if test="cycleList != null and cycleList.size>0">
             and p.plan_cycle in

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/edu/CoreEduTrainingPlanMapper.xml

@@ -640,7 +640,7 @@
         where p.deleted = 0
         and p.plan_status = 1
         <if test="cycle != null">
-            p.plan_cycle=#{cycle}
+            and  p.plan_cycle=#{cycle}
         </if>
         <if test="cycleList != null and cycleList.size>0">
             and p.plan_cycle in

+ 20 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/edu/PhysicalDeleteMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xunmei.core.edu.mapper.PhysicalDeleteMapper">
+
+    <delete id="deletedEduPlanByIds">
+        delete from core_edu_training_plan where id in
+        <foreach collection="list" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deletedDrillPlanByIds">
+        delete from core_drill_plan where id in
+        <foreach collection="list" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 13 - 6
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -45,12 +45,19 @@
           <if test="orgId !=null">
               AND a.org_id = #{orgId}
           </if>
-          <if test=" cycle ==2">
-              AND a.ymd_date like concat(#{date},'%')
-          </if>
-          <if test="cycle ==1 || cycle ==null">
-              AND a.ymd_date = #{date}
-          </if>
+        <choose>
+            <when test="req.appSelect ==1">
+                and a.ymd_date between #{req.startTime} and #{req.endTime}
+            </when>
+            <otherwise>
+                <if test=" req.cycle ==2">
+                    AND a.ymd_date like concat(#{req.searchTime},'%')
+                </if>
+                <if test="req.cycle ==1 || req.cycle ==null">
+                    AND a.ymd_date = #{req.searchTime}
+                </if>
+            </otherwise>
+        </choose>
         <if test="orgPath !=null">
             and a.org_path  like concat(#{orgPath},'%')
         </if>