Commit 2b450cc7 by huangjinxin

fix:服务工单改约不调用bean

1 parent f1bdd4b3
......@@ -152,9 +152,10 @@ public class BeanRemoteServiceImpl {
* @return 是否回调成功
*/
public boolean orderCancel(OrderCancel orderCancelParam) {
log.info("-----请求参数:{}", JsonUtil.toJson(orderCancelParam));
log.info("[服务工单取消]-----请求参数:{}", JsonUtil.toJson(orderCancelParam));
long timeMillis = System.currentTimeMillis();
BeanR<?> beanR = beanRemoteService.orderTaskCancel(getAccessToken(), orderCancelParam);
log.info("[服务工单取消]【/api/openapi/task/cancel】返回值-------------------->{}", JsonUtil.toJson(beanR));
log.info("[服务工单取消]【/api/openapi/task/cancel】耗时:{},返回值-------------------->{}", System.currentTimeMillis() - timeMillis, JsonUtil.toJson(beanR));
return beanR.getSuccess();
}
......@@ -167,9 +168,10 @@ public class BeanRemoteServiceImpl {
*/
public boolean orderRescheduled(Rescheduled rescheduled) {
log.info("-----请求参数:{}", JsonUtil.toJson(rescheduled));
log.info("[服务工单改约]-----请求参数:{}", JsonUtil.toJson(rescheduled));
long timeMillis = System.currentTimeMillis();
BeanR<?> beanRq = beanRemoteService.orderRescheduled(getAccessToken(), rescheduled);
log.info("[服务工单改约]【/api/openapi/task/rescheduled 】返回值-------------------->{}", JsonUtil.toJson(beanRq));
log.info("[服务工单改约]【/api/openapi/task/rescheduled 】耗时:{}返回值-------------------->{}", System.currentTimeMillis() - timeMillis, JsonUtil.toJson(beanRq));
return beanRq.getSuccess();
}
......
......@@ -274,6 +274,8 @@ public class OrderAssignImpl implements OrderAssign {
if (order.getOrderStatus().equals(OrderStatusEnum.CANCELED.getCode()) || order.getServiceStatus().equals(ServiceStatusEnum.FINISHED.getCode())) {
return Result.failed(StatusCodeEnum.ORDER_FINISHED);
}
final OrderInfoEntity sourceOrder = new OrderInfoEntity();
BeanUtils.copyProperties(sourceOrder, sourceOrder);
OrgTeamEntity orgTeam = orgTeamDao.getByTeamId(order.getOrgTeamId());
// 判断cutoff
Integer cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), orgTeam.getWorkOff());
......@@ -296,7 +298,12 @@ public class OrderAssignImpl implements OrderAssign {
order.setAppointEngineerCodes(null);
}
orderInfoDao.save(order);
//回调改约
Boolean boo = orderInfoService.rescheduled(sourceOrder, order, new Date(), "", "PEA");
log.info("[orderReschedule] orderId:{}, 通知bean结果: {}", sourceOrder.getOrderId(), boo);
if (!boo) {
throw new BusinessException("服务工单变更结果通知BEAN失败");
}
commonService.addOrderEvent(orderId, "", "PEA", "PEA", OrderEventEnum.backOrderPool.getEvent(), OrderEventEnum.backOrderPool.getMsg(), "");
return Result.success(null);
}
......
......@@ -219,13 +219,13 @@ public class OrderInfoServiceImpl implements OrderInfoService {
String engineerName = orderInfo.getEngineerName();
orderInfoDao.save(orderInfo);
//回调bean
OrderCancel orderCancelParam = new OrderCancel();
orderCancelParam.setRisId(orderId);
orderCancelParam.setCancelStartTime(happenDate.getTime());
Reason reason = new Reason();
reason.setOneLevel(request.getReschedulingReason());
orderCancelParam.setCancellationReason(reason);
beanRemoteService.orderCancel(orderCancelParam);
// OrderCancel orderCancelParam = new OrderCancel();
// orderCancelParam.setRisId(orderId);
// orderCancelParam.setCancelStartTime(happenDate.getTime());
// Reason reason = new Reason();
// reason.setOneLevel(request.getReschedulingReason());
// orderCancelParam.setCancellationReason(reason);
// beanRemoteService.orderCancel(orderCancelParam);
//记录流程
commonService.addOrderEvent(orderId, "", "BEAN", "BEAN", OrderEventEnum.cancel.getEvent(), String.format(OrderEventEnum.cancel.getMsg(), engineerName + "-" + (ObjectUtil.isNotNull(orgTeamEntity) ? orgTeamEntity.getTeamName() : "")), "", actualStartTime);
} else if (request.getOrderStatus().equalsIgnoreCase(OrderStatusEnum.RESCHEDULED.getCode())) {
......@@ -513,13 +513,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
rescheduled.setAssistantWorkNo(code.getCosmosId());
rescheduled.setAssOrgUnitId(code.getGroupId());
}
//判断是否是改派
if ((StringUtils.isNotBlank(target.getEngineerCode()) && !Objects.equals(engineerCode, source.getEngineerCode())) ||
(StringUtils.isNotBlank(target.getEngineerCodeSub()) && !Objects.equals(target.getEngineerCodeSub(), source.getEngineerCodeSub()))) {
rescheduled.setReassignment(Boolean.TRUE);
} else {
rescheduled.setReassignment(Boolean.FALSE);
}
return beanRemoteService.orderRescheduled(rescheduled);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!