|
@@ -1,5 +1,7 @@
|
|
|
package com.caimei365.manager.controller.caimei.user;
|
|
|
|
|
|
+import com.caimei365.manager.config.security.ConstantKey;
|
|
|
+import com.caimei365.manager.config.security.JwtService;
|
|
|
import com.caimei365.manager.entity.PaginationVo;
|
|
|
import com.caimei365.manager.entity.ResponseJson;
|
|
|
import com.caimei365.manager.entity.caimei.CmShop;
|
|
@@ -10,6 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
/**
|
|
|
* Description
|
|
|
*
|
|
@@ -21,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
public class CustomerApi {
|
|
|
|
|
|
@Autowired private CustomerService customerService;
|
|
|
+ @Resource private JwtService jwtService;
|
|
|
|
|
|
/**
|
|
|
* 潜客收集供应商列表
|
|
@@ -99,17 +105,52 @@ public class CustomerApi {
|
|
|
* 设置跟进状态
|
|
|
* @param id
|
|
|
* @param followUpStatus
|
|
|
+ * @param serviceProviderId
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/renewFollowUpStatus")
|
|
|
- public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus) {
|
|
|
+ public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus, Integer serviceProviderId) {
|
|
|
if (null == id) {
|
|
|
return ResponseJson.error(-1, "id不能为空", null);
|
|
|
}
|
|
|
if (null == followUpStatus) {
|
|
|
return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
}
|
|
|
- return customerService.renewFollowUpStatus(id, followUpStatus);
|
|
|
+ return customerService.renewFollowUpStatus(id, followUpStatus, serviceProviderId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加游客备注
|
|
|
+ * @param request
|
|
|
+ * @param cmInformationNotes
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/saveInformation")
|
|
|
+ public ResponseJson saveInformationNotes(HttpServletRequest request, CmInformationNotes cmInformationNotes) {
|
|
|
+ if (null == cmInformationNotes.getInformationId()) {
|
|
|
+ return ResponseJson.error(-1, "游客Id不能为空", null);
|
|
|
+ }
|
|
|
+ String token = request.getHeader(ConstantKey.TOKEN_NAME);
|
|
|
+ String username = jwtService.getUsername(token);
|
|
|
+ cmInformationNotes.setNoteUser(username);
|
|
|
+ return customerService.saveInformationNotes(cmInformationNotes);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取游客备注信息
|
|
|
+ * @param informationId
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getInformationNoteList")
|
|
|
+ public ResponseJson<PaginationVo<CmInformationNotes>> getInformationNotes(Integer informationId,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == informationId) {
|
|
|
+ return ResponseJson.error(-1, "游客Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getInformationNotes(informationId, pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -451,4 +492,89 @@ public class CustomerApi {
|
|
|
}
|
|
|
return customerService.getPageShopKeyword(shopId, startTime, endTime, pageNum, pageSize);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 意向数据列表
|
|
|
+ * @param shopId
|
|
|
+ * @param startTime
|
|
|
+ * @param endTime
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getIntentionUserList")
|
|
|
+ public ResponseJson<PaginationVo<CmShopIntentionUser>> getIntentionUserList(Integer shopId, String startTime, String endTime,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == shopId) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getIntentionUserList(shopId, startTime, endTime, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存意向客户数据
|
|
|
+ * @param cmShopIntentionUser
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/saveIntentionUser")
|
|
|
+ public ResponseJson saveIntentionUser(CmShopIntentionUser cmShopIntentionUser) {
|
|
|
+ if (null == cmShopIntentionUser.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getStartTime()) {
|
|
|
+ return ResponseJson.error(-1, "统计开始时间不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getEndTime()) {
|
|
|
+ return ResponseJson.error(-1, "统计结束时间不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getAppReadingVolume()) {
|
|
|
+ return ResponseJson.error(-1, "公众号阅读量不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getRedReadingVolume()) {
|
|
|
+ return ResponseJson.error(-1, "小红书阅读量不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getWbReadingVolume()) {
|
|
|
+ return ResponseJson.error(-1, "微博阅读量不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getOtherReadingVolume()) {
|
|
|
+ return ResponseJson.error(-1, "其他渠道阅读量不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getIntentionStrong()) {
|
|
|
+ return ResponseJson.error(-1, "意向强烈人数不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopIntentionUser.getIntentionOrdinary()) {
|
|
|
+ return ResponseJson.error(-1, "意向普通人数不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.saveIntentionUser(cmShopIntentionUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除意向客户数据
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewIntentionUser")
|
|
|
+ public ResponseJson renewIntentionUser(Integer id) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewIntentionUser(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加意向客户数据总结
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewIntentionNote")
|
|
|
+ public ResponseJson renewIntentionNote(Integer id, String note) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "意向客户数据id不能为空", null);
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(note)) {
|
|
|
+ return ResponseJson.error(-1, "意向客户数据总结不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewIntentionNote(id, note);
|
|
|
+ }
|
|
|
}
|