|
@@ -0,0 +1,449 @@
|
|
|
+package com.caimei365.manager.controller.caimei.user;
|
|
|
+
|
|
|
+import com.caimei365.manager.entity.PaginationVo;
|
|
|
+import com.caimei365.manager.entity.ResponseJson;
|
|
|
+import com.caimei365.manager.entity.caimei.CmShop;
|
|
|
+import com.caimei365.manager.entity.caimei.cmUser.*;
|
|
|
+import com.caimei365.manager.service.caimei.user.CustomerService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Description
|
|
|
+ *
|
|
|
+ * @author : Charles
|
|
|
+ * @date : 2023/9/5
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/user/customer")
|
|
|
+public class CustomerApi {
|
|
|
+
|
|
|
+ @Autowired private CustomerService customerService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 潜客收集供应商列表
|
|
|
+ * @param cmShopStatistics
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getCustomerShopList")
|
|
|
+ public ResponseJson<PaginationVo<CmShopStatistics>> getCustomerShopList(CmShopStatistics cmShopStatistics,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ return customerService.getCustomerShopList(cmShopStatistics, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商列表
|
|
|
+ * @param shopName
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopList")
|
|
|
+ public ResponseJson<PaginationVo<CmShop>> getShopList(String shopName,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ return customerService.getShopLiat(shopName, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加统计供应商
|
|
|
+ * @param shopIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/saveCustomerShop")
|
|
|
+ public ResponseJson saveCustomerShop(String shopIds) {
|
|
|
+ if (null == shopIds) {
|
|
|
+ return ResponseJson.error(-1, "添加的供应商不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.saveCustomerShop(shopIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置统计状态
|
|
|
+ * @param id
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewCustomerShop")
|
|
|
+ public ResponseJson renewCustomerShop(Integer id, Integer status) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == status) {
|
|
|
+ return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewCustomerShop(id, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 游客统计
|
|
|
+ * @param cmRoosInformation
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getCmInformationList")
|
|
|
+ public ResponseJson<PaginationVo<CmRoosInformation>> getCmInformationList(CmRoosInformation cmRoosInformation,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == cmRoosInformation.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getCmInformationList(cmRoosInformation, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置跟进状态
|
|
|
+ * @param id
|
|
|
+ * @param followUpStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewFollowUpStatus")
|
|
|
+ public ResponseJson renewFollowUpStatus(Integer id, Integer followUpStatus) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == followUpStatus) {
|
|
|
+ return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewFollowUpStatus(id, followUpStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 相关文章列表
|
|
|
+ * @param cmShopInfo
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopInfoList")
|
|
|
+ public ResponseJson<PaginationVo<CmShopInfo>> getShopInfoList(CmShopInfo cmShopInfo,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == cmShopInfo.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getShopInfoList(cmShopInfo, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择文章
|
|
|
+ * @param id
|
|
|
+ * @param title
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getInfoList")
|
|
|
+ public ResponseJson<PaginationVo<Info>> getInfoList(Integer id, String title,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ return customerService.getInfoList(id, title, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加文章统计
|
|
|
+ * @param shopId
|
|
|
+ * @param infoIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/saveShopInfo")
|
|
|
+ public ResponseJson saveShopInfo(Integer shopId, String infoIds){
|
|
|
+ if (null == shopId) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == infoIds) {
|
|
|
+ return ResponseJson.error(-1, "选择文章不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.saveShopInfo(shopId, infoIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置统计状态
|
|
|
+ * @param id
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewShopInfo")
|
|
|
+ public ResponseJson renewShopInfo(Integer id, Integer status) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == status) {
|
|
|
+ return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewShopInfo(id, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除统计文章
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/delShopInfo")
|
|
|
+ public ResponseJson delShopInfo(Integer id) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.delShopInfo(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 相关搜索词统计列表
|
|
|
+ * @param cmShopKeyword
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopKeywordList")
|
|
|
+ public ResponseJson<PaginationVo<CmShopKeyword>> getShopKeywordList(CmShopKeyword cmShopKeyword,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == cmShopKeyword.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getShopKeywordList(cmShopKeyword, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择文章
|
|
|
+ * @param keyword
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getSearchFrequencyList")
|
|
|
+ public ResponseJson<PaginationVo<CmUserSearchFrequency>> getSearchFrequencyList(String keyword,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ return customerService.getSearchFrequencyList(keyword, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加文章统计
|
|
|
+ * @param shopId
|
|
|
+ * @param keyWordIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/saveShopKeyword")
|
|
|
+ public ResponseJson saveShopKeyword(Integer shopId, String keyWordIds){
|
|
|
+ if (null == shopId) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == keyWordIds) {
|
|
|
+ return ResponseJson.error(-1, "选择文章不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.saveShopKeyword(shopId, keyWordIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置统计状态
|
|
|
+ * @param id
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewShopKeyword")
|
|
|
+ public ResponseJson renewShopKeyword(Integer id, Integer status) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == status) {
|
|
|
+ return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewShopKeyword(id, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除统计文章
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/delShopKeyword")
|
|
|
+ public ResponseJson delShopKeyword(Integer id) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.delShopKeyword(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 弹框信息回显
|
|
|
+ * @param shopId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopPopUp")
|
|
|
+ public ResponseJson<CmShopPopUp> getShopPopUp(Integer shopId) {
|
|
|
+ if (null == shopId) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getShopPopUp(shopId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 弹框信息回显
|
|
|
+ * @param cmShopPopUp
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/saveShopPopUp")
|
|
|
+ public ResponseJson saveShopPopUp(CmShopPopUp cmShopPopUp) {
|
|
|
+ if (null == cmShopPopUp.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopPopUp.getImage()) {
|
|
|
+ return ResponseJson.error(-1, "显示图不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopPopUp.getGuidingOne()) {
|
|
|
+ return ResponseJson.error(-1, "引导语不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == cmShopPopUp.getGuidingTwo()) {
|
|
|
+ return ResponseJson.error(-1, "引导语不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.saveShopPopUp(cmShopPopUp);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商广告列表
|
|
|
+ * @param cmShopAdvertisingImage
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopAdvertisingImage")
|
|
|
+ public ResponseJson<PaginationVo<CmShopAdvertisingImage>> getShopAdvertisingImage(CmShopAdvertisingImage cmShopAdvertisingImage,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
+ if (null == cmShopAdvertisingImage.getShopId()) {
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getShopAdvertisingImage(cmShopAdvertisingImage, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商广告信息回显
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getShopAdvertisingImageById")
|
|
|
+ public ResponseJson<CmShopAdvertisingImage> getShopAdvertisingImageById(Integer id) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "Id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.getShopAdvertisingImageById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存供应商广告信息
|
|
|
+ * @param cmShopAdvertisingImage
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/saveShopAdvertisingImage")
|
|
|
+ public ResponseJson saveShopAdvertisingImage(CmShopAdvertisingImage cmShopAdvertisingImage) {
|
|
|
+
|
|
|
+ return customerService.saveShopAdvertisingImage(cmShopAdvertisingImage);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 一键排序
|
|
|
+ * @param advertisingImages
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewShopAdvertisingImageSort")
|
|
|
+ public ResponseJson renewShopAdvertisingImageSort(String advertisingImages) {
|
|
|
+ if (StringUtils.isBlank(advertisingImages)) {
|
|
|
+ return ResponseJson.error(-1, "排序数据不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewShopAdvertisingImageSort(advertisingImages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改上下架状态
|
|
|
+ * @param id
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/renewShopAdvertisingImageStatus")
|
|
|
+ public ResponseJson renewShopAdvertisingImageStatus(Integer id, Integer status) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ if (null == status) {
|
|
|
+ return ResponseJson.error(-1, "状态不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.renewShopAdvertisingImageStatus(id, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除广告
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/delShopAdvertisingImage")
|
|
|
+ public ResponseJson delShopAdvertisingImage(Integer id) {
|
|
|
+ if (null == id) {
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
+ }
|
|
|
+ return customerService.delShopAdvertisingImage(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商主页统计
|
|
|
+ * @param shopId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getPageShop")
|
|
|
+ ResponseJson<PaginationVo<CmPageShop>> getPageShop(Integer shopId,
|
|
|
+ @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.getPageShop(shopId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商商品统计
|
|
|
+ * @param shopId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getPageShopProduct")
|
|
|
+ public ResponseJson<PaginationVo<CmPageShopProduct>> getPageShopProduct(Integer shopId,
|
|
|
+ @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.getPageShopProduct(shopId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商文章
|
|
|
+ * @param shopId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getPageShopInfo")
|
|
|
+ public ResponseJson<PaginationVo<CmPageShopInfo>> getPageShopInfo(Integer shopId,
|
|
|
+ @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.getPageShopInfo(shopId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 供应商搜索词统计
|
|
|
+ * @param shopId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getPageShopKeyword")
|
|
|
+ public ResponseJson<PaginationVo<CmPageShopKeyword>> getPageShopKeyword(Integer shopId,
|
|
|
+ @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.getPageShopKeyword(shopId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+}
|