Commit dacdcd13 by huangjinxin

fix:放回工单池处理cutoff逻辑

1 parent d64e0934
...@@ -143,6 +143,8 @@ public enum StatusCodeEnum { ...@@ -143,6 +143,8 @@ public enum StatusCodeEnum {
ORDER_RESCHEDULE_BEFORE_TIME("028", "订单不能改约到当前时间以前!", false), ORDER_RESCHEDULE_BEFORE_TIME("028", "订单不能改约到当前时间以前!", false),
TEAM_UNMATCHED("029", "工程师没有匹配到工作队", false), TEAM_UNMATCHED("029", "工程师没有匹配到工作队", false),
ORDER_FINISHED("030", "订单已结束,请勿操作", false),
; ;
/** /**
......
...@@ -64,6 +64,8 @@ public class OrderServiceDetailResp { ...@@ -64,6 +64,8 @@ public class OrderServiceDetailResp {
private String expectTimeBegin; private String expectTimeBegin;
private String expectTimeEnd;
private String expectTimeDesc; private String expectTimeDesc;
private String source; private String source;
......
...@@ -194,11 +194,24 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -194,11 +194,24 @@ public class OrderAssignImpl implements OrderAssign {
if (order == null) { if (order == null) {
return Result.failed("订单不存在"); return Result.failed("订单不存在");
} }
if (order.getOrderStatus().equals(OrderStatusEnum.CANCELED.getCode()) || order.getServiceStatus().equals(ServiceStatusEnum.FINISHED.getCode())) {
return Result.failed(StatusCodeEnum.ORDER_FINISHED);
}
OrgTeamEntity orgTeam = orgTeamDao.getByTeamId(order.getOrgTeamId());
// 判断cutoff
Integer cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), orgTeam.getWorkOff());
if (cutoff > 0) {
// cutoff更新order_request表为人工指派
order.setAppointmentStatus(AppointmentMethodEnum.MANUAL.name());
order.setServiceStatus(OrderFlowEnum.INIT.name());
order = OrderUtil.handleErrorOrder(order);
order.setIsCutoff(cutoff);
} else {
// 更新order_request表为未指派 // 更新order_request表为未指派
order.setAppointmentStatus(OrderFlowEnum.INIT.name()); order.setAppointmentStatus(OrderFlowEnum.INIT.name());
order.setServiceStatus(OrderFlowEnum.INIT.name()); order.setServiceStatus(OrderFlowEnum.INIT.name());
order = OrderUtil.handleErrorOrder(order); order = OrderUtil.handleErrorOrder2(order);
}
orderInfoDao.save(order); orderInfoDao.save(order);
commonService.addOrderEvent(orderId, "", "PEA", "PEA", OrderEventEnum.backOrderPool.getEvent(), OrderEventEnum.backOrderPool.getMsg(), ""); commonService.addOrderEvent(orderId, "", "PEA", "PEA", OrderEventEnum.backOrderPool.getEvent(), OrderEventEnum.backOrderPool.getMsg(), "");
......
...@@ -79,6 +79,7 @@ public class OrderServiceDetailImpl implements OrderServiceDetail { ...@@ -79,6 +79,7 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
res.setSkill(order.getSkill()); res.setSkill(order.getSkill());
res.setFaultDescribe(order.getFaultDescribe()); res.setFaultDescribe(order.getFaultDescribe());
res.setExpectTimeBegin(TimeUtils.IsoLocalDateTime2String(order.getExpectTimeBegin())); res.setExpectTimeBegin(TimeUtils.IsoLocalDateTime2String(order.getExpectTimeBegin()));
res.setExpectTimeEnd(TimeUtils.IsoLocalDateTime2String(order.getExpectTimeEnd()));
res.setExpectTimeDesc(order.getExpectTimeDesc()); res.setExpectTimeDesc(order.getExpectTimeDesc());
res.setSource(order.getSource()); res.setSource(order.getSource());
res.setTags(order.getTags()); res.setTags(order.getTags());
......
...@@ -18,4 +18,17 @@ public class OrderUtil { ...@@ -18,4 +18,17 @@ public class OrderUtil {
return order; return order;
} }
/**
* 分单,超派,特殊时间等处理工单指派工程师,网点等数据
*
* @param order
* @return
*/
public static OrderInfoEntity handleErrorOrder2(OrderInfoEntity order) {
order.setEngineerPhone(null);
order.setEngineerName(null);
order.setEngineerCode(null);
return order;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!