From 206f601b1f2a2e3cb0bf4f5dead01bec9077d8e9 Mon Sep 17 00:00:00 2001
From: 彭雪彬 <1724387007@qq.com>
Date: Thu, 04 Sep 2025 15:28:52 +0800
Subject: [PATCH] Merge branch 'xin' into pxb
---
oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
index bfcf1c1..8e0c22d 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreCustomerController.java
@@ -1,5 +1,7 @@
package com.oying.modules.pc.store.rest;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.ObjUtil;
import com.oying.modules.pc.product.domain.Product;
import com.oying.modules.pc.product.domain.dto.ProductQueryCriteria;
@@ -18,7 +20,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
-import org.springframework.beans.BeanUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -59,7 +60,7 @@
public ResponseEntity<?> getStoreById(@PathVariable("storeId") Long storeId) {
Store store = storeService.getById(storeId);
CustomerStoreView view = new CustomerStoreView();
- BeanUtils.copyProperties(store, view);
+ BeanUtil.copyProperties(store, view, CopyOptions.create().setIgnoreNullValue(true));
view.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime()));
return ResponseEntity.ok(R.success(view));
}
@@ -68,10 +69,13 @@
@ApiOperation("查询店铺")
public ResponseEntity<?> getStoreDetailsById(@PathVariable("storeId") Long storeId) {
Store store = storeService.getById(storeId);
+ CustomerStoreView view = new CustomerStoreView();
+ BeanUtil.copyProperties(store, view, CopyOptions.create().setIgnoreNullValue(true));
+ view.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime()));
if (ObjUtil.isNotEmpty(store)) {
- store.setQualifications(storeQualificationService.getByStoreId(storeId));
+ view.setQualifications(storeQualificationService.getByStoreId(storeId));
}
- return ResponseEntity.ok(R.success(store));
+ return ResponseEntity.ok(R.success(view));
}
private List<Product> getProductsByStoreId(Long storeId) {
--
Gitblit v1.9.3