Commit 8905fedb by Ren Ping

feat:优化自动派单任务,支持如下功能

3.1,算法运行截止时间是动态的,根据工作队的cutoff配置来的,cutoff时间之后需要将订单'指派状态'改成'已指派'
3.3,算法需要根据工作队类型决定是否自动派工,自有和外网自动派单,网点不自动派工
1 parent f93ab0af
package com.dituhui.pea.dispatch.service.impl; package com.dituhui.pea.dispatch.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.dituhui.pea.dispatch.dao.DispatchBatchRepository; import com.dituhui.pea.dispatch.dao.DispatchBatchRepository;
import com.dituhui.pea.dispatch.dao.OrgGroupRepository;
import com.dituhui.pea.dispatch.dao.OrgTeamDao; import com.dituhui.pea.dispatch.dao.OrgTeamDao;
import com.dituhui.pea.dispatch.entity.DispatchBatch; import com.dituhui.pea.dispatch.entity.DispatchBatch;
import com.dituhui.pea.dispatch.entity.OrgGroup;
import com.dituhui.pea.dispatch.entity.OrgTeamEntity; import com.dituhui.pea.dispatch.entity.OrgTeamEntity;
import com.dituhui.pea.dispatch.pojo.DispatchSolution; import com.dituhui.pea.dispatch.pojo.DispatchSolution;
import com.dituhui.pea.dispatch.service.BatchService; import com.dituhui.pea.dispatch.service.BatchService;
...@@ -59,6 +62,9 @@ public class SchedulerServiceImpl implements SchedulerService { ...@@ -59,6 +62,9 @@ public class SchedulerServiceImpl implements SchedulerService {
@Autowired @Autowired
OrgTeamDao orgTeamDao; OrgTeamDao orgTeamDao;
@Autowired
OrgGroupRepository orgGroupRepository;
private DefaultSolverFactory<DispatchSolution> solverFactory; private DefaultSolverFactory<DispatchSolution> solverFactory;
@Resource @Resource
...@@ -78,8 +84,10 @@ public class SchedulerServiceImpl implements SchedulerService { ...@@ -78,8 +84,10 @@ public class SchedulerServiceImpl implements SchedulerService {
return; return;
} }
if (StrUtil.equals(DEFAULT_STRATEGY_APPOINTMENT, orgTeamEntity.getStrategyAppointment())) { OrgGroup orgGroup=orgGroupRepository.findByGroupId(orgTeamEntity.getGroupId()).get();
log.error(">>> teamId:{} " + DEFAULT_STRATEGY_APPOINTMENT, teamId);
if (ObjectUtil.equals(2, orgGroup.getCategory())) {
log.error(">>> teamId:{} 来自网点,不自动派工", teamId);
return; return;
} }
......
...@@ -3,7 +3,7 @@ server: ...@@ -3,7 +3,7 @@ server:
dispatch: dispatch:
cron: cron:
expr: 0 45 8-22 * * ? expr: 0 14 8-22 * * ?
next-day-limit: 2 next-day-limit: 2
# expr: 0 */10 8-18 * * ? # expr: 0 */10 8-18 * * ?
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!