|
|
@@ -43,10 +43,12 @@ import com.xunmei.core.thread.ThreadPoolConfig;
|
|
|
import com.xunmei.system.api.RemoteFileService;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.RemoteRoleService;
|
|
|
+import com.xunmei.system.api.RemoteWorkTimeService;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
import com.xunmei.system.api.domain.SysUser;
|
|
|
import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -71,6 +73,7 @@ import java.util.stream.Collectors;
|
|
|
* @author xunmei
|
|
|
* @date 2023-08-27
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingTaskMapper, CoreEduTrainingTask> implements ICoreEduTrainingTaskService {
|
|
|
@Autowired
|
|
|
@@ -99,6 +102,9 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
|
|
|
@Qualifier(ThreadPoolConfig.SOC_EXECUTOR)
|
|
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteWorkTimeService workTimeService;
|
|
|
+
|
|
|
@Override
|
|
|
public TableDataInfo<CoreEduTrainingTaskPageVo> selectPage(CoreEduTrainingTaskPageDto request) {
|
|
|
//如果是web段的查询
|
|
|
@@ -350,7 +356,11 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public void createTaskForNow(CoreEduTrainingPlanDataVo plan, Date start, Date end) {
|
|
|
-
|
|
|
+ List<String> workTimeList = workTimeService.findWorkTimeByDateRangeAndOrgId(start, end, plan.getBelongOrgId());
|
|
|
+ if (workTimeList.isEmpty()){
|
|
|
+ log.error("未获取到该机构的作息时间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
//如果不是无周期的计划,那么需要查询出他的时间范围
|
|
|
if (plan.getPlanCycle() != 0) {
|
|
|
DateRange dateRange = DateUtils.getStartAndEnd(new Date(), plan.getPlanCycle());
|