Commit 03360c7c by 丁伟峰

虚拟指派异常捕获,不影响主流程

1 parent 355444e3
......@@ -180,8 +180,16 @@ public class OrderCreateServiceImpl implements OrderCreateService {
break;
}
}
// 虚拟指派登记
// 虚拟指派
if (StringUtils.isNotBlank(assignEngineerCode)){
tryVirtualAppointment(req, entity, orderId, assignEngineerCode);
}
return Result.success(null);
}
private void tryVirtualAppointment(OrderCreateReqDTO req, OrderRequestEntity entity, String orderId, String assignEngineerCode) {
try {
OrderAppointmentEntity oa = new OrderAppointmentEntity();
oa.setDt(entity.getDt());
oa.setOrderId(entity.getOrderId());
......@@ -190,7 +198,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
oa.setEngineerCode(assignEngineerCode);
EngineerInfoEntity engineerInfo = engineerInfoDao.getByEngineerCode(assignEngineerCode);
oa.setEngineerName(engineerInfo.getName());
if(StringUtils.isNotBlank(engineerInfo.getBirth())) {
if (StringUtils.isNotBlank(engineerInfo.getBirth())) {
int age = (int) DateUtils.getAge(engineerInfo.getBirth());
oa.setEngineerAge(age);
} else {
......@@ -206,9 +214,13 @@ public class OrderCreateServiceImpl implements OrderCreateService {
oa.setUpdateTime(LocalDateTime.now());
orderAppointmentDao.save(oa);
// 登记
commonService.addOrderEvent(orderId, "", req.getSource(), "API", "虚拟指派", "虚拟指派", "" );
}
commonService.addOrderEvent(orderId, "", req.getSource(), "API", "虚拟指派", "虚拟指派", "");
return Result.success(null);
log.info("==== 已经完成虚拟指派 ====");
} catch (Exception e){
log.error("虚拟指派错误: {}", e.getMessage());
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!