|
@@ -201,51 +201,84 @@ public class LawyerClientConsultationOrderServiceImpl extends ServiceImpl<Lawyer
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取咨询订单详情
|
|
* 获取咨询订单详情
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 查询订单基本信息、律师信息和律师问题场景信息
|
|
|
|
|
+ * </p>
|
|
|
*
|
|
*
|
|
|
* @param lawyerOrderId 订单ID
|
|
* @param lawyerOrderId 订单ID
|
|
|
- * @return 咨询订单详情VO
|
|
|
|
|
|
|
+ * @return 咨询订单详情VO,如果订单不存在或参数为空则返回空对象
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public LawyerConsultationOrderVO getConsultationOrderDetail(String lawyerOrderId) {
|
|
public LawyerConsultationOrderVO getConsultationOrderDetail(String lawyerOrderId) {
|
|
|
- log.info("LawyerConsultationOrderServiceImpl.getConsultationOrderDetail?lawyerOrderId={}", lawyerOrderId);
|
|
|
|
|
-
|
|
|
|
|
- LawyerConsultationOrderVO orderVO = new LawyerConsultationOrderVO();
|
|
|
|
|
|
|
+ log.info("获取咨询订单详情,订单ID={}", lawyerOrderId);
|
|
|
|
|
|
|
|
// 参数校验
|
|
// 参数校验
|
|
|
if (!StringUtils.hasText(lawyerOrderId)) {
|
|
if (!StringUtils.hasText(lawyerOrderId)) {
|
|
|
- return orderVO;
|
|
|
|
|
|
|
+ log.warn("获取咨询订单详情失败:订单ID为空");
|
|
|
|
|
+ return new LawyerConsultationOrderVO();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询订单信息
|
|
// 查询订单信息
|
|
|
LawyerConsultationOrder order = consultationOrderMapper.selectById(lawyerOrderId);
|
|
LawyerConsultationOrder order = consultationOrderMapper.selectById(lawyerOrderId);
|
|
|
if (order == null) {
|
|
if (order == null) {
|
|
|
- return orderVO;
|
|
|
|
|
|
|
+ log.warn("获取咨询订单详情失败:订单不存在,订单ID={}", lawyerOrderId);
|
|
|
|
|
+ return new LawyerConsultationOrderVO();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 复制订单基本信息
|
|
// 复制订单基本信息
|
|
|
|
|
+ LawyerConsultationOrderVO orderVO = new LawyerConsultationOrderVO();
|
|
|
BeanUtils.copyProperties(order, orderVO);
|
|
BeanUtils.copyProperties(order, orderVO);
|
|
|
|
|
|
|
|
- // 查询并填充律师信息
|
|
|
|
|
- Integer lawyerUserId = order.getLawyerUserId();
|
|
|
|
|
- if (lawyerUserId != null) {
|
|
|
|
|
- LawyerUser lawyerUser = lawyerUserMapper.selectById(lawyerUserId);
|
|
|
|
|
- if (lawyerUser != null) {
|
|
|
|
|
- fillLawyerInfo(orderVO, lawyerUser);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 填充律师相关信息
|
|
|
|
|
+ fillLawyerRelatedInfo(orderVO, order.getLawyerUserId());
|
|
|
|
|
|
|
|
|
|
+ return orderVO;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // 查询律师问题场景
|
|
|
|
|
- List<Integer> lawyerIdList = Collections.singletonList(lawyerUserId);
|
|
|
|
|
- Map<String, List<String>> serviceAreaMap = getLawyerServiceArea(lawyerIdList);
|
|
|
|
|
- String lawyerUserIdStr = String.valueOf(lawyerUserId);
|
|
|
|
|
- if (!serviceAreaMap.isEmpty() && serviceAreaMap.containsKey(lawyerUserIdStr)) {
|
|
|
|
|
- orderVO.setLawyerLegalProblemScenarioList(serviceAreaMap.get(lawyerUserIdStr));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 填充律师相关信息到订单VO
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 包括律师基本信息和律师问题场景列表
|
|
|
|
|
+ * </p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param orderVO 订单VO对象
|
|
|
|
|
+ * @param lawyerUserId 律师用户ID
|
|
|
|
|
+ */
|
|
|
|
|
+ private void fillLawyerRelatedInfo(LawyerConsultationOrderVO orderVO, Integer lawyerUserId) {
|
|
|
|
|
+ if (lawyerUserId == null) {
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return orderVO;
|
|
|
|
|
|
|
+ // 查询并填充律师基本信息
|
|
|
|
|
+ LawyerUser lawyerUser = lawyerUserMapper.selectById(lawyerUserId);
|
|
|
|
|
+ if (lawyerUser != null) {
|
|
|
|
|
+ fillLawyerInfo(orderVO, lawyerUser);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询并填充律师问题场景
|
|
|
|
|
+ fillLawyerServiceAreaForOrder(orderVO, lawyerUserId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 填充律师问题场景信息到订单VO
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param orderVO 订单VO对象
|
|
|
|
|
+ * @param lawyerUserId 律师用户ID
|
|
|
|
|
+ */
|
|
|
|
|
+ private void fillLawyerServiceAreaForOrder(LawyerConsultationOrderVO orderVO, Integer lawyerUserId) {
|
|
|
|
|
+ List<Integer> lawyerIdList = Collections.singletonList(lawyerUserId);
|
|
|
|
|
+ Map<String, List<String>> serviceAreaMap = getLawyerServiceArea(lawyerIdList);
|
|
|
|
|
+
|
|
|
|
|
+ if (serviceAreaMap.isEmpty()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String lawyerUserIdStr = String.valueOf(lawyerUserId);
|
|
|
|
|
+ List<String> serviceAreaList = serviceAreaMap.get(lawyerUserIdStr);
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(serviceAreaList)) {
|
|
|
|
|
+ orderVO.setLawyerLegalProblemScenarioList(serviceAreaList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询咨询订单信息(律师端)
|
|
* 查询咨询订单信息(律师端)
|