Commit 211f6cb2 by huangjinxin

fix:改约,取消优化一家多单逻辑

1 parent a59c3f65
......@@ -161,6 +161,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
if (StringUtils.isBlank(request.getDescription())) {
orderInfo.setDescription(request.getDescription());
}
//处理一家多单逻辑
Result<String> deleteMultipleOrders = this.deleteMultipleOrders(orderInfo.getMultipleOrders(), orderInfo.getAddressId());
if (!deleteMultipleOrders.getCode().equals(ResultEnum.SUCCESS.getCode())) {
throw new BusinessException("改约日期失败");
}
orderInfoDao.save(orderInfo);
//记录流程
commonService.addOrderEvent(request.getOrderId(), "", "BEAN", "BEAN", OrderStatusEnum.CANCELED.getDescription(), request.getStage(), "", LocalDateTimeUtil.of(request.getHappen()));
......@@ -210,6 +215,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
}
LocalDateTime expectEnd = TimeUtils.IsoDateTime2LocalDateTime(req.getExpectEnd());
OrderInfoEntity order = orderInfoDao.getByOrderId(req.getOrderId());
LocalDate orderDt = order.getDt();
order.setDt(expectBegin.toLocalDate());
order.setExpectTimeBegin(expectBegin);
order.setExpectTimeEnd(expectEnd);
......@@ -234,7 +240,6 @@ public class OrderInfoServiceImpl implements OrderInfoService {
// ii.网点:优先改约指派给当前网点
// (不给当前工程师)
if (!isToday && isBelong) {
order = handleMultipleOrders(order);
} else if (isToday && isBelong) {
// b.已派人-改约到当天
// i.自有:优先改约指派给当前工程师
......@@ -318,8 +323,6 @@ public class OrderInfoServiceImpl implements OrderInfoService {
order.setIsSpecialTime(CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(),
order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff()));
}
//处理一家多单
order = handleMultipleOrders(order);
} else if (isToday && !isBelong) {
// b.未派人-改约到当天
// i.人工指派
......@@ -331,6 +334,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
sendMsg(branchEntity.getBranchId(), order.getOrderId(), req.getExpectBegin());
}
//处理一家多单
// order = handleMultipleOrders(order);
if (!orderDt.isEqual(expectBegin.toLocalDate())){
order = handleMultipleOrders(order);
}
order.setOrgClusterId(clusterId);
order.setOrgBranchId(branchId);
orderInfoDao.save(order);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!