增加状态更新接口客户的状态可以是线索高一项第1项客户
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.rj.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.rj.config.MinIOConfig;
|
||||
import com.rj.dto.CustomerPhotoPreviewResult;
|
||||
import com.rj.dto.CustomerPhotoUploadResult;
|
||||
import com.rj.dto.CustomerStageUpdateResult;
|
||||
import com.rj.entity.CustomerManagement;
|
||||
import com.rj.mapper.CustomerManagementMapper;
|
||||
import com.rj.service.ICustomerManagementService;
|
||||
@@ -15,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -65,6 +68,32 @@ public class CustomerManagementServiceImpl extends ServiceImpl<CustomerManagemen
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerStageUpdateResult updateCustomerStage(String id, String stage) {
|
||||
try {
|
||||
if (id == null || id.trim().isEmpty()) {
|
||||
return CustomerStageUpdateResult.badRequest("客户ID不能为空");
|
||||
}
|
||||
String idTrim = id.trim();
|
||||
if (getById(idTrim) == null) {
|
||||
return CustomerStageUpdateResult.badRequest("客户不存在");
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
boolean updated = update(
|
||||
new LambdaUpdateWrapper<CustomerManagement>()
|
||||
.eq(CustomerManagement::getId, idTrim)
|
||||
.set(CustomerManagement::getStage, stage)
|
||||
.set(CustomerManagement::getUpdateTime, now));
|
||||
if (!updated) {
|
||||
return CustomerStageUpdateResult.badRequest("阶段更新失败");
|
||||
}
|
||||
return CustomerStageUpdateResult.ok(getById(idTrim));
|
||||
} catch (Exception e) {
|
||||
log.error("客户阶段更新失败: {}", e.getMessage(), e);
|
||||
return CustomerStageUpdateResult.serverError("阶段更新异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerPhotoPreviewResult openCustomerPhotoPreview(String url, String id, String photoType) {
|
||||
String photoUrl = null;
|
||||
|
||||
@@ -36,13 +36,13 @@ public class NearbyMerchantSearchServiceImpl implements INearbyMerchantSearchSer
|
||||
/** 与 customer_management 正面/侧面/生活照三字段一致 */
|
||||
private static final int MAX_PHOTO_URLS = 3;
|
||||
|
||||
/** 高德采集写入客户时的默认门店/销售/意向(可按业务调整) */
|
||||
/** 高德采集写入客户时的默认门店/销售/阶段(可按业务调整) */
|
||||
private static final String DEFAULT_DEALERSHIP_ID = "1957424710587330562";
|
||||
private static final String DEFAULT_DEALERSHIP_NAME = "北京移多旺科技有限公司";
|
||||
private static final String DEFAULT_SALES_ID = "2";
|
||||
private static final String DEFAULT_SALES_NAME = "15810181776";
|
||||
private static final String DEFAULT_SALES_PHONE = "15810181776";
|
||||
private static final String DEFAULT_INTENDED_MODEL = "线索";
|
||||
private static final String DEFAULT_STAGE = "线索";
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
private final ObjectMapper objectMapper;
|
||||
@@ -337,7 +337,7 @@ public class NearbyMerchantSearchServiceImpl implements INearbyMerchantSearchSer
|
||||
c.setSalesId(DEFAULT_SALES_ID);
|
||||
c.setSalesName(DEFAULT_SALES_NAME);
|
||||
c.setSalesPhone(DEFAULT_SALES_PHONE);
|
||||
c.setIntendedModel(DEFAULT_INTENDED_MODEL);
|
||||
c.setStage(DEFAULT_STAGE);
|
||||
}
|
||||
|
||||
/** 接口检索参数 CITY、ADDRESS 两段拼接写入 {@code remark} */
|
||||
|
||||
Reference in New Issue
Block a user