补充客户信息
This commit is contained in:
@@ -6,11 +6,13 @@ import com.rj.common.AudioManagementConstants;
|
||||
import com.rj.common.DataEnrichmentUtil;
|
||||
import com.rj.dto.CustomerPhotoPreviewResult;
|
||||
import com.rj.dto.CustomerPhotoUploadResult;
|
||||
import com.rj.dto.NearbyMerchantSearchResult;
|
||||
import com.rj.entity.AudioManagement;
|
||||
import com.rj.entity.CustomerManagement;
|
||||
import com.rj.entity.SalesManagement;
|
||||
import com.rj.service.IAudioManagementService;
|
||||
import com.rj.service.ICustomerManagementService;
|
||||
import com.rj.service.INearbyMerchantSearchService;
|
||||
import com.rj.service.ISalesManagementService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -53,6 +55,9 @@ public class CustomerManagementController {
|
||||
@Autowired
|
||||
private ISalesManagementService salesManagementService;
|
||||
|
||||
@Autowired
|
||||
private INearbyMerchantSearchService nearbyMerchantSearchService;
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*/
|
||||
@@ -202,6 +207,30 @@ public class CustomerManagementController {
|
||||
@Autowired
|
||||
private DataEnrichmentUtil dataEnrichmentUtil;
|
||||
|
||||
/**
|
||||
* 根据城市与地址做地理编码,再按半径搜索周边商家(高德 place/around,逻辑同 AllShopCollectorV5)。
|
||||
*/
|
||||
@GetMapping("/searchNearbyMerchants")
|
||||
@Operation(summary = "附近商家检索", description = "根据 CITY、ADDRESS 解析坐标,按 RADIUS、MAX_PAGE、maxRecordsOfpage 调用高德周边搜索")
|
||||
public ResponseEntity<Map<String, Object>> searchNearbyMerchants(
|
||||
@Parameter(description = "城市(传给高德地理编码 city)", required = true) @RequestParam("CITY") String city,
|
||||
@Parameter(description = "地址/地标(传给高德地理编码 address)", required = true) @RequestParam("ADDRESS") String address,
|
||||
@Parameter(description = "搜索半径(米)", required = true) @RequestParam("RADIUS") int radius,
|
||||
@Parameter(description = "最大请求页数", required = true) @RequestParam("MAX_PAGE") int maxPage,
|
||||
@Parameter(description = "每页条数(1~50,高德 offset)", required = true) @RequestParam("maxRecordsOfpage") int maxRecordsOfpage) {
|
||||
NearbyMerchantSearchResult search = nearbyMerchantSearchService.searchNearbyMerchants(
|
||||
city, address, radius, maxPage, maxRecordsOfpage);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("success", search.isSuccess());
|
||||
result.put("message", search.getMessage());
|
||||
if (search.isSuccess()) {
|
||||
result.put("centerLocation", search.getCenterLocation());
|
||||
result.put("totalCount", search.getTotalCount());
|
||||
result.put("data", search.getMerchants());
|
||||
}
|
||||
return ResponseEntity.status(search.getHttpStatus()).body(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询客户列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user