|
|
@@ -15,6 +15,7 @@ import org.springframework.util.StringUtils;
|
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.*;
|
|
|
import shop.alien.entity.store.vo.LawyerUserVo;
|
|
|
+import shop.alien.lawyer.config.BaseRedisService;
|
|
|
import shop.alien.lawyer.service.LawyerLegalProblemScenarioService;
|
|
|
import shop.alien.lawyer.service.LawyerServiceAreaService;
|
|
|
import shop.alien.lawyer.service.LawyerUserSearchHistoryService;
|
|
|
@@ -44,6 +45,7 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
private final LawyerLegalProblemScenarioService lawyerLegalProblemScenarioService;
|
|
|
private final LawyerConsultationOrderMapper lawyerConsultationOrderMapper;
|
|
|
private final LawFirmMapper lawFirmMapper;
|
|
|
+ private final BaseRedisService baseRedisService;
|
|
|
|
|
|
@Override
|
|
|
public R<IPage<LawyerUser>> getLawyerUserList(int pageNum, int pageSize, String name, String phone, Integer status) {
|
|
|
@@ -356,14 +358,13 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
/**
|
|
|
* 获取AI推荐律师列表
|
|
|
*
|
|
|
- * @param page 页码
|
|
|
- * @param size 页大小
|
|
|
- * @param categoryId 分类ID
|
|
|
- * @return R<IPage<LawyerUser>> 推荐律师列表
|
|
|
+ * @param page 页码
|
|
|
+ * pageSize 页大小
|
|
|
+ * categoryId 分类ID
|
|
|
*/
|
|
|
@Override
|
|
|
public R<IPage<LawyerUser>> getAiRecommendList(int page, int size, Integer categoryId) {
|
|
|
- log.info("LawyerUserServiceImpl.getAiRecommendList?page={},size={},categoryId={}",
|
|
|
+ log.info("LawyerUserController.aiRecommendList?page={},size={},categoryId={}",
|
|
|
page, size, categoryId);
|
|
|
|
|
|
// 构建查询条件
|
|
|
@@ -432,6 +433,12 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
return R.fail("律师不存在");
|
|
|
}
|
|
|
|
|
|
+ String key = "lawyer_" + lawyerUser.getPhone();
|
|
|
+ String redisVerificationCode = baseRedisService.getString(key);
|
|
|
+ //对redisVerificationCode进行校验,如果不是空的话清除redis中的记录
|
|
|
+ if (redisVerificationCode != null) {
|
|
|
+ baseRedisService.delete(key);
|
|
|
+ }
|
|
|
// 检查是否已经注销
|
|
|
if (lawyerUser.getLogoutFlag() != null && lawyerUser.getLogoutFlag() == 1) {
|
|
|
log.warn("注销律师用户失败:律师已注销,律师ID={}, 律师姓名={}", id, lawyerUser.getName());
|
|
|
@@ -444,20 +451,20 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
return R.fail("该律师账号已删除");
|
|
|
}
|
|
|
|
|
|
- List<LawyerConsultationOrder> orderList = lawyerConsultationOrderMapper.selectOrder(null, id);
|
|
|
+ List<LawyerConsultationOrder> list=lawyerConsultationOrderMapper.selectOrder(null, id);
|
|
|
+
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(orderList)) {
|
|
|
+ if (!CollectionUtils.isEmpty( list)){
|
|
|
// 提示前端有未完成订单 1:有未完成订单 0:无未完成订单
|
|
|
resultMap.put("unfinishedOrder", 1);
|
|
|
}
|
|
|
|
|
|
- if (lawyerUser.getOrderReceivingStatus() != null && lawyerUser.getOrderReceivingStatus() == 1) {
|
|
|
+ if (lawyerUser.getOrderReceivingStatus() != null && lawyerUser.getOrderReceivingStatus() == 1){
|
|
|
// 提示前端接单状态为接单中 1:接单中 0:未接单
|
|
|
resultMap.put("orderReceivingStatus", 1);
|
|
|
}
|
|
|
|
|
|
- // 只有无未完成订单且状态为禁用时,才执行注销操作
|
|
|
- if (CollectionUtils.isEmpty(orderList) && lawyerUser.getStatus() == 0) {
|
|
|
+ if (CollectionUtils.isEmpty( list) || lawyerUser.getStatus() == 0){
|
|
|
// 设置注销相关字段
|
|
|
lawyerUser.setLogoutFlag(1); // 注销标记:1-已注销
|
|
|
lawyerUser.setLogoutTime(new Date()); // 注销时间
|
|
|
@@ -491,7 +498,7 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R<LawyerUser> getLawyerInfo(Integer lawyerId) {
|
|
|
+ public R<LawyerUserVo> getLawyerInfo(Integer lawyerId) {
|
|
|
log.info("LawyerUserServiceImpl.getLawyerInfo?lawyerId={}", lawyerId);
|
|
|
|
|
|
// 参数校验
|
|
|
@@ -513,34 +520,29 @@ public class LawyerUserServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerU
|
|
|
return R.fail("律师信息已删除");
|
|
|
}
|
|
|
|
|
|
- LawFirm lawFirm = lawFirmMapper.selectById(lawyer.getFirmId());
|
|
|
- if (lawFirm != null) {
|
|
|
- // 如果需要在返回对象中设置律所信息,可以在这里处理
|
|
|
- // 目前直接返回 LawyerUser 对象
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(lawyer);
|
|
|
+ LawyerUserVo result=lawyerUserMapper.selectInfo(lawyerId);
|
|
|
+ return R.data(result);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public R<LawyerUser> updateLawyerUser(LawyerUserVo lawyerUserVo) {
|
|
|
log.info("LawyerUserServiceImpl.updateLawyerUser?lawyerUserVo={}", lawyerUserVo);
|
|
|
-
|
|
|
+
|
|
|
// 参数校验
|
|
|
if (lawyerUserVo == null || lawyerUserVo.getId() == null) {
|
|
|
log.warn("更新律师用户信息失败:参数为空或律师ID为空");
|
|
|
return R.fail("律师ID不能为空");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
LawyerUser lawyerUser = new LawyerUser();
|
|
|
BeanUtils.copyProperties(lawyerUserVo, lawyerUser);
|
|
|
-
|
|
|
+
|
|
|
Integer result = lawyerUserMapper.updateLawyerUser(lawyerUser);
|
|
|
if (result <= 0) {
|
|
|
log.warn("更新律师用户信息失败:更新数据库失败,律师ID={}", lawyerUserVo.getId());
|
|
|
return R.fail("修改律师信息失败");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 查询更新后的律师信息
|
|
|
LawyerUser updatedLawyer = this.getById(lawyerUserVo.getId());
|
|
|
log.info("更新律师用户信息成功,律师ID={}", lawyerUserVo.getId());
|