Commit 56716539 by huangjinxin

fix:分单超派特殊时间处理,变更技能指派方式优化

1 parent ae80855e
......@@ -145,6 +145,8 @@ public enum StatusCodeEnum {
TEAM_UNMATCHED("029", "工程师没有匹配到工作队", false),
ORDER_FINISHED("030", "订单已结束,请勿操作", false),
FENDAN_IS_TRANSCEND_AND_SPECIAL("031", "分单超派和特殊时间", false),
;
/**
......
......@@ -43,6 +43,7 @@ public interface OrgTeamDao extends JpaRepository<OrgTeamEntity, Integer>, JpaSp
@Query("UPDATE OrgTeamEntity tt SET tt.status = :status WHERE tt.teamId = :teamId")
void updateStatusByTeamId(String teamId, int status);
@Query("select t from OrgTeamEntity t where t.teamId in :ids and t.status=1")
public List<OrgTeamEntity> findByTeamIdIn(List<String> ids);
public List<OrgTeamEntity> findByClusterIdIn(List<String> ids);
......
......@@ -13,6 +13,7 @@ import com.dituhui.pea.order.dto.param.OrgTeamInfo;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.CapacityQueryService;
import com.dituhui.pea.order.service.FendanService;
import com.dituhui.pea.order.utils.CommonUtil;
import com.dituhui.pea.pojo.fendan.FendanDTO;
import com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq;
import com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp;
......@@ -311,6 +312,13 @@ public class FendanServiceImpl implements FendanService {
return Result.success(orgGroupInfo.getTeamInfos().get(0));
}
}
// 超派情况判断特殊时间
//特殊时间段
Integer special = CommonUtil.isSpecial(startTime, endTime, orgGroupTeamInfos.get(0).getTeamInfos().get(0).getWorkOn(),
orgGroupTeamInfos.get(0).getTeamInfos().get(0).getWorkOff());
if (special == 1) {
return Result.failed(StatusCodeEnum.FENDAN_IS_TRANSCEND_AND_SPECIAL);
}
return Result.failed(StatusCodeEnum.FENDAN_IS_TRANSCEND);
}
......
......@@ -355,6 +355,11 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 处理超派
entity.setTranscend(1);
}
if (fendanResult.getCode().equals(StatusCodeEnum.FENDAN_IS_TRANSCEND_AND_SPECIAL.getCode())) {
// 处理超派和特殊时间
entity.setTranscend(1);
entity.setIsSpecialTime(1);
}
OrgBranchEntity branchEntity = orgBranchDao.findByCitycodeListLike("%" + adminDistrict.getResult().getSubNames().getCity() + "%");
entity.setOrgClusterId(branchEntity.getClusterId());
entity.setOrgBranchId(branchEntity.getBranchId());
......
......@@ -418,6 +418,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
} else {
cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), null);
}
// 当日单指派策略为人工指派,次日单动态排班自动批量
if (isToday || cutoff == 1) {
order.setAppointmentMethod(AppointmentMethodEnum.MANUAL.name());
order.setAppointmentStatus(OrderFlowEnum.INIT.name());
}
order.setIsCutoff(cutoff);
order.setIsSpecialTime(special);
order.setOrgClusterId(clusterId);
......@@ -684,6 +689,26 @@ public class OrderInfoServiceImpl implements OrderInfoService {
//处理超派,特殊时间段
// order.setIsSpecialTime(CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(),
// order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff()));
//特殊时间段
Integer special = CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(),
order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff());
Integer cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), teamInfo.getWorkOff());
// 处理cutoff 动态排班结束后创建的当日单和次日单
boolean isTomorrow = DateUtil.judgeTimeIsisTomorrow(order.getExpectTimeBegin());
//次日单自动批量
if (isTomorrow) {
order.setAppointmentMethod(AppointmentMethodEnum.AUTO_BATCH.name());
}
// 特殊时间段,当天单,cutoff需要人工处理
if (cutoff == 1 || special == 1) {
//判断是否在今天cutoff之后
order.setIsCutoff(cutoff);
order.setIsSpecialTime(special);
order.setAppointmentMethod(AppointmentMethodEnum.MANUAL.name());
order.setAppointmentStatus(OrderFlowEnum.INIT.name());
//发送通知分部消息
sendMsg(order.getOrgBranchId(), order.getOrderId(), req.getExpectBegin());
}
}
return order;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!