|
@@ -7,6 +7,7 @@ import com.caimei365.manager.entity.PaginationVo;
|
|
import com.caimei365.manager.entity.ResponseJson;
|
|
import com.caimei365.manager.entity.ResponseJson;
|
|
import com.caimei365.manager.entity.caimei.CmShop;
|
|
import com.caimei365.manager.entity.caimei.CmShop;
|
|
import com.caimei365.manager.entity.caimei.cmUser.*;
|
|
import com.caimei365.manager.entity.caimei.cmUser.*;
|
|
|
|
+import com.caimei365.manager.entity.caimei.product.Product;
|
|
import com.caimei365.manager.service.caimei.user.CustomerService;
|
|
import com.caimei365.manager.service.caimei.user.CustomerService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Description
|
|
* Description
|
|
@@ -87,6 +89,91 @@ public class CustomerApi {
|
|
return customerService.renewCustomerShop(id, status);
|
|
return customerService.renewCustomerShop(id, status);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 潜客商品列表
|
|
|
|
+ * @param id
|
|
|
|
+ * @param productId
|
|
|
|
+ * @param productName
|
|
|
|
+ * @param pageNum
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getShopProduct")
|
|
|
|
+ public ResponseJson<PaginationVo<CmShopProduct>> getShopProduct(Integer id, Integer productId, String productName,
|
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
|
|
+ if (null == id) {
|
|
|
|
+ return ResponseJson.error(-1, "id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return customerService.getShopProduct(id, productId, productName, pageNum, pageSize);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 商品列表
|
|
|
|
+ * @param shopId
|
|
|
|
+ * @param productId
|
|
|
|
+ * @param productName
|
|
|
|
+ * @param pageNum
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getProductList")
|
|
|
|
+ public ResponseJson<PaginationVo<Product>> getProductList(Integer shopId, Integer productId, String productName,
|
|
|
|
+ @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.getProductList(shopId, productId, productName, pageNum, pageSize);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存潜客供应商统计商品
|
|
|
|
+ * @param id
|
|
|
|
+ * @param productIds
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/saveShopProduct")
|
|
|
|
+ public ResponseJson saveShopProduct(Integer id, String productIds) {
|
|
|
|
+ if (null == id) {
|
|
|
|
+ return ResponseJson.error(-1, "潜客供应商统计id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(productIds)) {
|
|
|
|
+ return ResponseJson.error(-1, "商品id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return customerService.saveShopProduct(id, productIds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 设置潜客商品统计状态
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/renewShopProduct")
|
|
|
|
+ public ResponseJson renewShopProduct(Integer id, Integer status) {
|
|
|
|
+ if (null == id) {
|
|
|
|
+ return ResponseJson.error(-1, "潜客供应商商品统计id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (null == status) {
|
|
|
|
+ return ResponseJson.error(-1, "统计状态不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return customerService.updateProductStatus(id, status);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除潜客供应商统计商品
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/deleteShopProduct")
|
|
|
|
+ public ResponseJson deleteShopProduct(Integer id) {
|
|
|
|
+ if (null == id) {
|
|
|
|
+ return ResponseJson.error(-1, "潜客供应商商品统计id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return customerService.updateShopProduct(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 游客统计
|
|
* 游客统计
|
|
* @param cmRoosInformation
|
|
* @param cmRoosInformation
|
|
@@ -98,8 +185,8 @@ public class CustomerApi {
|
|
public ResponseJson<PaginationVo<CmRoosInformation>> getCmInformationList(CmRoosInformation cmRoosInformation,
|
|
public ResponseJson<PaginationVo<CmRoosInformation>> getCmInformationList(CmRoosInformation cmRoosInformation,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
- if (null == cmRoosInformation.getShopId()) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ if (null == cmRoosInformation.getShopProductId()) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
return customerService.getCmInformationList(cmRoosInformation, pageNum, pageSize);
|
|
return customerService.getCmInformationList(cmRoosInformation, pageNum, pageSize);
|
|
}
|
|
}
|
|
@@ -168,8 +255,8 @@ public class CustomerApi {
|
|
public ResponseJson<PaginationVo<CmShopInfo>> getShopInfoList(CmShopInfo cmShopInfo,
|
|
public ResponseJson<PaginationVo<CmShopInfo>> getShopInfoList(CmShopInfo cmShopInfo,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
- if (null == cmShopInfo.getShopId()) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ if (null == cmShopInfo.getShopProductId()) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
return customerService.getShopInfoList(cmShopInfo, pageNum, pageSize);
|
|
return customerService.getShopInfoList(cmShopInfo, pageNum, pageSize);
|
|
}
|
|
}
|
|
@@ -191,19 +278,19 @@ public class CustomerApi {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加文章统计
|
|
* 添加文章统计
|
|
- * @param shopId
|
|
|
|
|
|
+ * @param shopProductId
|
|
* @param infoIds
|
|
* @param infoIds
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/saveShopInfo")
|
|
@GetMapping("/saveShopInfo")
|
|
- public ResponseJson saveShopInfo(Integer shopId, String infoIds){
|
|
|
|
- if (null == shopId) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ public ResponseJson saveShopInfo(Integer shopProductId, String infoIds){
|
|
|
|
+ if (null == shopProductId) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
if (null == infoIds) {
|
|
if (null == infoIds) {
|
|
return ResponseJson.error(-1, "选择文章不能为空", null);
|
|
return ResponseJson.error(-1, "选择文章不能为空", null);
|
|
}
|
|
}
|
|
- return customerService.saveShopInfo(shopId, infoIds);
|
|
|
|
|
|
+ return customerService.saveShopInfo(shopProductId, infoIds);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -247,8 +334,8 @@ public class CustomerApi {
|
|
public ResponseJson<PaginationVo<CmShopKeyword>> getShopKeywordList(CmShopKeyword cmShopKeyword,
|
|
public ResponseJson<PaginationVo<CmShopKeyword>> getShopKeywordList(CmShopKeyword cmShopKeyword,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
- if (null == cmShopKeyword.getShopId()) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ if (null == cmShopKeyword.getShopProductId()) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
return customerService.getShopKeywordList(cmShopKeyword, pageNum, pageSize);
|
|
return customerService.getShopKeywordList(cmShopKeyword, pageNum, pageSize);
|
|
}
|
|
}
|
|
@@ -269,19 +356,19 @@ public class CustomerApi {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加搜索词统计
|
|
* 添加搜索词统计
|
|
- * @param shopId
|
|
|
|
|
|
+ * @param shopProductId
|
|
* @param keyWordIds
|
|
* @param keyWordIds
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/saveShopKeyword")
|
|
@GetMapping("/saveShopKeyword")
|
|
- public ResponseJson saveShopKeyword(Integer shopId, String keyWordIds){
|
|
|
|
- if (null == shopId) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ public ResponseJson saveShopKeyword(Integer shopProductId, String keyWordIds){
|
|
|
|
+ if (null == shopProductId) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
if (null == keyWordIds) {
|
|
if (null == keyWordIds) {
|
|
return ResponseJson.error(-1, "选择搜索词不能为空", null);
|
|
return ResponseJson.error(-1, "选择搜索词不能为空", null);
|
|
}
|
|
}
|
|
- return customerService.saveShopKeyword(shopId, keyWordIds);
|
|
|
|
|
|
+ return customerService.saveShopKeyword(shopProductId, keyWordIds);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -316,15 +403,15 @@ public class CustomerApi {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 弹框信息回显
|
|
* 弹框信息回显
|
|
- * @param shopId
|
|
|
|
|
|
+ * @param shopProductId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getShopPopUp")
|
|
@GetMapping("/getShopPopUp")
|
|
- public ResponseJson<CmShopPopUp> getShopPopUp(Integer shopId) {
|
|
|
|
- if (null == shopId) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ public ResponseJson<CmShopPopUp> getShopPopUp(Integer shopProductId) {
|
|
|
|
+ if (null == shopProductId) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
- return customerService.getShopPopUp(shopId);
|
|
|
|
|
|
+ return customerService.getShopPopUp(shopProductId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -334,8 +421,8 @@ public class CustomerApi {
|
|
*/
|
|
*/
|
|
@PostMapping("/saveShopPopUp")
|
|
@PostMapping("/saveShopPopUp")
|
|
public ResponseJson saveShopPopUp(@RequestBody CmShopPopUp cmShopPopUp) {
|
|
public ResponseJson saveShopPopUp(@RequestBody CmShopPopUp cmShopPopUp) {
|
|
- if (null == cmShopPopUp.getShopId()) {
|
|
|
|
- return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
|
|
+ if (null == cmShopPopUp.getShopProductId()) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商商品统计Id不能为空", null);
|
|
}
|
|
}
|
|
if (null == cmShopPopUp.getImage()) {
|
|
if (null == cmShopPopUp.getImage()) {
|
|
return ResponseJson.error(-1, "显示图不能为空", null);
|
|
return ResponseJson.error(-1, "显示图不能为空", null);
|
|
@@ -437,6 +524,19 @@ public class CustomerApi {
|
|
return customerService.delShopAdvertisingImage(id);
|
|
return customerService.delShopAdvertisingImage(id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取潜客供应商下统计商品
|
|
|
|
+ * @param shopId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getShopProductList")
|
|
|
|
+ public ResponseJson<List<CmShopProduct>> getShopProductList(Integer shopId) {
|
|
|
|
+ if (null == shopId) {
|
|
|
|
+ return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return customerService.getShopProductList(shopId);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 供应商主页统计
|
|
* 供应商主页统计
|
|
* @param shopId
|
|
* @param shopId
|
|
@@ -475,13 +575,13 @@ public class CustomerApi {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getPageShopInfo")
|
|
@GetMapping("/getPageShopInfo")
|
|
- public ResponseJson<PaginationVo<CmPageShopInfo>> getPageShopInfo(Integer shopId, String startTime, String endTime,
|
|
|
|
|
|
+ public ResponseJson<PaginationVo<CmPageShopInfo>> getPageShopInfo(Integer shopId, Integer productId, String startTime, String endTime,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
if (null == shopId) {
|
|
if (null == shopId) {
|
|
return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
}
|
|
}
|
|
- return customerService.getPageShopInfo(shopId, startTime, endTime, pageNum, pageSize);
|
|
|
|
|
|
+ return customerService.getPageShopInfo(shopId, productId, startTime, endTime, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -490,12 +590,12 @@ public class CustomerApi {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getPageShopKeyword")
|
|
@GetMapping("/getPageShopKeyword")
|
|
- public ResponseJson<PaginationVo<CmPageShopKeyword>> getPageShopKeyword(Integer shopId, String startTime, String endTime,
|
|
|
|
|
|
+ public ResponseJson<PaginationVo<CmPageShopKeyword>> getPageShopKeyword(Integer shopId, Integer productId, String startTime, String endTime,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
@RequestParam(value = "pageSize",defaultValue = "20") int pageSize) {
|
|
if (null == shopId) {
|
|
if (null == shopId) {
|
|
return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
return ResponseJson.error(-1, "供应商Id不能为空", null);
|
|
}
|
|
}
|
|
- return customerService.getPageShopKeyword(shopId, startTime, endTime, pageNum, pageSize);
|
|
|
|
|
|
+ return customerService.getPageShopKeyword(shopId, productId, startTime, endTime, pageNum, pageSize);
|
|
}
|
|
}
|
|
}
|
|
}
|