소스 검색

人员详情加入店铺名称和店铺手机号

zc 3 달 전
부모
커밋
4aef065ce1

+ 12 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreStaffDetailWithPerformanceVo.java

@@ -47,5 +47,17 @@ public class StoreStaffDetailWithPerformanceVo implements Serializable {
      */
     @ApiModelProperty(value = "是否喜欢(true-已喜欢,false-未喜欢)")
     private Boolean isLiked;
+
+    /**
+     * 店铺名称
+     */
+    @ApiModelProperty(value = "店铺名称")
+    private String storeName;
+
+    /**
+     * 店铺电话
+     */
+    @ApiModelProperty(value = "店铺电话")
+    private String storePhone;
 }
 

+ 22 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -886,6 +886,24 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             // 判断是否喜欢(根据userId查询点赞记录)
             Boolean isLiked = checkIsLiked(id, userId);
 
+            // 查询店铺信息(店铺名称和店铺电话)
+            String storeName = null;
+            String storePhone = null;
+            if (staffConfig.getStoreId() != null && staffConfig.getStoreId() > 0) {
+                try {
+                    StoreInfo storeInfo = storeInfoMapper.selectById(staffConfig.getStoreId());
+                    if (storeInfo != null) {
+                        storeName = storeInfo.getStoreName();
+                        storePhone = storeInfo.getStoreTel();
+                    } else {
+                        log.warn("查询店铺信息失败,店铺不存在:storeId={}", staffConfig.getStoreId());
+                    }
+                } catch (Exception e) {
+                    log.warn("查询店铺信息异常,storeId={},异常信息:{}", staffConfig.getStoreId(), e.getMessage());
+                    // 店铺信息查询失败不影响整体返回,设置为null即可
+                }
+            }
+
             // 构建返回对象
             StoreStaffDetailWithPerformanceVo result =
                     new StoreStaffDetailWithPerformanceVo();
@@ -893,9 +911,11 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             result.setPerformanceScheduleList(performanceScheduleList);
             result.setHasPerformanceToday(hasPerformanceToday);
             result.setIsLiked(isLiked);
+            result.setStoreName(storeName);
+            result.setStorePhone(storePhone);
 
-            log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{},是否喜欢:{}",
-                    id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday, isLiked);
+            log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{},是否喜欢:{},店铺名称:{},店铺电话:{}",
+                    id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday, isLiked, storeName, storePhone);
             return result;
         } catch (Exception e) {
             log.error("查询员工详情(包含演出列表)异常,id={},异常信息:{}", id, e.getMessage(), e);