|
@@ -27,12 +27,14 @@ import shop.alien.entity.store.vo.PerformanceScheduleVo;
|
|
|
import shop.alien.entity.store.StoreComment;
|
|
import shop.alien.entity.store.StoreComment;
|
|
|
import shop.alien.entity.store.StoreStaffReview;
|
|
import shop.alien.entity.store.StoreStaffReview;
|
|
|
import shop.alien.entity.store.StoreStaffTitle;
|
|
import shop.alien.entity.store.StoreStaffTitle;
|
|
|
|
|
+import shop.alien.entity.store.LifeLikeRecord;
|
|
|
import shop.alien.entity.store.vo.StaffTitleGroupVo;
|
|
import shop.alien.entity.store.vo.StaffTitleGroupVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo;
|
|
import shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
|
|
import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
|
|
|
import shop.alien.mapper.*;
|
|
import shop.alien.mapper.*;
|
|
|
|
|
+import shop.alien.mapper.LifeLikeRecordMapper;
|
|
|
import shop.alien.store.service.StoreStaffConfigService;
|
|
import shop.alien.store.service.StoreStaffConfigService;
|
|
|
import shop.alien.store.service.StoreStaffFitnessBaseService;
|
|
import shop.alien.store.service.StoreStaffFitnessBaseService;
|
|
|
import shop.alien.store.service.StoreStaffFitnessCertificationService;
|
|
import shop.alien.store.service.StoreStaffFitnessCertificationService;
|
|
@@ -92,6 +94,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
|
|
|
|
|
private final StoreStaffFitnessExperienceService storeStaffFitnessExperienceService;
|
|
private final StoreStaffFitnessExperienceService storeStaffFitnessExperienceService;
|
|
|
|
|
|
|
|
|
|
+ private final LifeLikeRecordMapper lifeLikeRecordMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 认证类型:认证
|
|
* 认证类型:认证
|
|
|
*/
|
|
*/
|
|
@@ -939,8 +943,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
* @return 员工详情(包含演出列表),如果员工不存在则返回null
|
|
* @return 员工详情(包含演出列表),如果员工不存在则返回null
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id) {
|
|
|
|
|
- log.info("查询员工详情(包含演出列表),id={}", id);
|
|
|
|
|
|
|
+ public StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id, Integer userId) {
|
|
|
|
|
+ log.info("查询员工详情(包含演出列表),id={},userId={}", id, userId);
|
|
|
|
|
|
|
|
// 参数校验
|
|
// 参数校验
|
|
|
if (id == null || id <= 0) {
|
|
if (id == null || id <= 0) {
|
|
@@ -963,15 +967,19 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
// 判断今日是否有演出
|
|
// 判断今日是否有演出
|
|
|
Boolean hasPerformanceToday = checkHasPerformanceToday(id);
|
|
Boolean hasPerformanceToday = checkHasPerformanceToday(id);
|
|
|
|
|
|
|
|
|
|
+ // 判断是否喜欢(根据userId查询点赞记录)
|
|
|
|
|
+ Boolean isLiked = checkIsLiked(id, userId);
|
|
|
|
|
+
|
|
|
// 构建返回对象
|
|
// 构建返回对象
|
|
|
StoreStaffDetailWithPerformanceVo result =
|
|
StoreStaffDetailWithPerformanceVo result =
|
|
|
new StoreStaffDetailWithPerformanceVo();
|
|
new StoreStaffDetailWithPerformanceVo();
|
|
|
result.setStaffInfo(staffConfig);
|
|
result.setStaffInfo(staffConfig);
|
|
|
result.setPerformanceScheduleList(performanceScheduleList);
|
|
result.setPerformanceScheduleList(performanceScheduleList);
|
|
|
result.setHasPerformanceToday(hasPerformanceToday);
|
|
result.setHasPerformanceToday(hasPerformanceToday);
|
|
|
|
|
+ result.setIsLiked(isLiked);
|
|
|
|
|
|
|
|
- log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{}",
|
|
|
|
|
- id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday);
|
|
|
|
|
|
|
+ log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{},是否喜欢:{}",
|
|
|
|
|
+ id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday, isLiked);
|
|
|
return result;
|
|
return result;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("查询员工详情(包含演出列表)异常,id={},异常信息:{}", id, e.getMessage(), e);
|
|
log.error("查询员工详情(包含演出列表)异常,id={},异常信息:{}", id, e.getMessage(), e);
|
|
@@ -1805,4 +1813,36 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
|
|
|
throw new RuntimeException("根据标题ID查询员工列表失败:" + e.getMessage(), e);
|
|
throw new RuntimeException("根据标题ID查询员工列表失败:" + e.getMessage(), e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 检查用户是否喜欢该员工
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 根据userId查询life_like_record表,判断是否存在点赞记录
|
|
|
|
|
+ * type = "8" 表示点赞员工
|
|
|
|
|
+ * </p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param staffId 员工ID
|
|
|
|
|
+ * @param userId 用户ID,可为null(未登录时返回false)
|
|
|
|
|
+ * @return true-已喜欢,false-未喜欢
|
|
|
|
|
+ */
|
|
|
|
|
+ private Boolean checkIsLiked(Integer staffId, Integer userId) {
|
|
|
|
|
+ // 如果用户未登录,返回false
|
|
|
|
|
+ if (userId == null || userId <= 0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ LambdaQueryWrapper<LifeLikeRecord> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(LifeLikeRecord::getType, "8") // 8-点赞员工
|
|
|
|
|
+ .eq(LifeLikeRecord::getDianzanId, String.valueOf(userId))
|
|
|
|
|
+ .eq(LifeLikeRecord::getHuifuId, String.valueOf(staffId))
|
|
|
|
|
+ .eq(LifeLikeRecord::getDeleteFlag, 0);
|
|
|
|
|
+ long count = lifeLikeRecordMapper.selectCount(queryWrapper);
|
|
|
|
|
+ return count > 0;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询员工是否喜欢异常,staffId={},userId={},异常信息:{}",
|
|
|
|
|
+ staffId, userId, e.getMessage(), e);
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|