123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498 |
- 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;
- import com.caimei365.manager.entity.caimei.cmUser.*;
- import com.caimei365.manager.service.caimei.user.CustomerService;
- import lombok.extern.slf4j.Slf4j;
- import org.apache.commons.lang3.StringUtils;
- 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
- *
- * @author : Charles
- * @date : 2023/9/5
- */
- @Slf4j
- @RestController
- @RequestMapping("/user/customer")
- public class CustomerApi {
- @Autowired private CustomerService customerService;
- @Resource private JwtService jwtService;
- /**
- * 潜客收集供应商列表
- * @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
- * @param serviceProviderId
- * @return
- */
- @GetMapping("/renewFollowUpStatus")
- 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, serviceProviderId);
- }
- /**
- * 添加游客备注
- * @param request
- * @param cmInformationNotes
- * @return
- */
- @PostMapping("/saveInformation")
- public ResponseJson saveInformationNotes(HttpServletRequest request,@RequestBody CmInformationNotes cmInformationNotes) {
- log.info("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);
- }
- /**
- * 相关文章列表
- * @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/{id}")
- public ResponseJson delShopInfo(@PathVariable("id") 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/{id}")
- public ResponseJson delShopKeyword(@PathVariable("id") 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(@RequestBody 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) {
- return customerService.getShopAdvertisingImage(cmShopAdvertisingImage, pageNum, pageSize);
- }
- /**
- * 供应商广告信息回显
- * @param id
- * @return
- */
- @GetMapping("/getShopAdvertisingImageById/{id}")
- public ResponseJson<CmShopAdvertisingImage> getShopAdvertisingImageById(@PathVariable("id") Integer id) {
- if (null == id) {
- return ResponseJson.error(-1, "Id不能为空", null);
- }
- return customerService.getShopAdvertisingImageById(id);
- }
- /**
- * 保存供应商广告信息
- * @param cmShopAdvertisingImage
- * @return
- */
- @PostMapping("/saveShopAdvertisingImage")
- public ResponseJson saveShopAdvertisingImage(@RequestBody CmShopAdvertisingImage cmShopAdvertisingImage) {
- return customerService.saveShopAdvertisingImage(cmShopAdvertisingImage);
- }
- /**
- * 一键排序
- * @param id
- * @param sort
- * @return
- */
- @GetMapping("/renewShopAdvertisingImageSort")
- public ResponseJson renewShopAdvertisingImageSort(Integer id, Integer sort) {
- if (null == id) {
- return ResponseJson.error(-1, "排序数据id不能为空", null);
- }
- if (null == sort) {
- return ResponseJson.error(-1, "排序指不能为空", null);
- }
- return customerService.renewShopAdvertisingImageSort(id, sort);
- }
- /**
- * 修改上下架状态
- * @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/{id}")
- public ResponseJson delShopAdvertisingImage(@PathVariable("id") Integer id) {
- if (null == id) {
- return ResponseJson.error(-1, "id不能为空", null);
- }
- return customerService.delShopAdvertisingImage(id);
- }
- /**
- * 供应商主页统计
- * @param shopId
- * @param startTime
- * @param endTime
- * @return
- */
- @GetMapping("/getPageShop")
- ResponseJson<PaginationVo<CmPageShop>> getPageShop(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.getPageShop(shopId, startTime, endTime, pageNum, pageSize);
- }
- /**
- * 供应商商品统计
- * @param shopId
- * @return
- */
- @GetMapping("/getPageShopProduct")
- public ResponseJson<PaginationVo<CmPageShopProduct>> getPageShopProduct(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.getPageShopProduct(shopId, startTime, endTime, pageNum, pageSize);
- }
- /**
- * 供应商文章统计
- * @param shopId
- * @return
- */
- @GetMapping("/getPageShopInfo")
- public ResponseJson<PaginationVo<CmPageShopInfo>> getPageShopInfo(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.getPageShopInfo(shopId, startTime, endTime, pageNum, pageSize);
- }
- /**
- * 供应商搜索词统计
- * @param shopId
- * @return
- */
- @GetMapping("/getPageShopKeyword")
- public ResponseJson<PaginationVo<CmPageShopKeyword>> getPageShopKeyword(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.getPageShopKeyword(shopId, startTime, endTime, pageNum, pageSize);
- }
- }
|