浏览代码

门店详情接口回显营业时间businessHours

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
qmj 1 月之前
父节点
当前提交
f490cce805
共有 1 个文件被更改,包括 8 次插入 和 1 次删除
  1. 8 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosStoreController.java

+ 8 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosStoreController.java

@@ -442,7 +442,14 @@ public class PosStoreController extends BaseController {
     @PreAuthorize("@ss.hasPermi('chanting:store:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
-        return success(posStoreService.selectPosStoreById(id));
+        PosStore posStore = posStoreService.selectPosStoreById(id);
+        // 回显营业时间(按周几分组的 timeSlots),供编辑门店时显示
+        if (posStore != null) {
+            LambdaQueryWrapper<OperatingHours> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(OperatingHours::getMdId, id);
+            posStore.setBusinessHours(getStoreOperatOutput(operatingHoursService.list(wrapper), id));
+        }
+        return success(posStore);
     }
 
     /**