jiangqs
2023-06-13 d6e5d5a71112fb1f0a7361485e80692cc03bc4c3
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java
@@ -4,17 +4,15 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.shop.domain.dto.*;
import com.ruoyi.shop.domain.vo.MgtShopInfoVo;
import com.ruoyi.shop.domain.vo.MgtShopPageVo;
import com.ruoyi.shop.domain.vo.MgtShopProportionPageVo;
import com.ruoyi.shop.domain.vo.MgtShopTagVo;
import com.ruoyi.shop.service.shop.ShopProportionService;
import com.ruoyi.shop.service.shop.ShopRelTagService;
import com.ruoyi.shop.service.shop.ShopService;
import com.ruoyi.shop.domain.vo.*;
import com.ruoyi.shop.service.shop.*;
import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@@ -40,13 +38,26 @@
    @Resource
    private ShopProportionService shopProportionService;
    @Resource
    private ShopSuggestService shopSuggestService;
    @Resource
    private ShopCertificateService shopCertificateService;
    @RequestMapping(value = "/listMgtShopSimpleVo", method = RequestMethod.POST)
    @ApiOperation(value = "分页获取商户列表")
    public R<List<MgtShopListSimpleVo>> listMgtShopSimpleVo(@RequestBody MgtShopListDto mgtShopListDto) {
        List<MgtShopListSimpleVo> mgtShopListSimpleVoList = shopService.listMgtShopSimpleVo(mgtShopListDto);
        return R.ok(mgtShopListSimpleVoList);
    }
    @RequestMapping(value = "/pageMgtShop", method = RequestMethod.POST)
    @ApiOperation(value = "分页获取商户列表")
    public R<Page<MgtShopPageVo>> pageMgtShop(@RequestBody MgtShopPageDto mgtShopPageDto) {
        Page<MgtShopPageVo> page = new Page<>();
        page.setSize(mgtShopPageDto.getPageSize());
        page.setCurrent(mgtShopPageDto.getPageNum());
        List<MgtShopPageVo> mgtShopPageVoList = shopService.pageShop(page,mgtShopPageDto);
        List<MgtShopPageVo> mgtShopPageVoList = shopService.pageMgtShop(page,mgtShopPageDto);
        return R.ok(page.setRecords(mgtShopPageVoList));
    }
@@ -69,7 +80,7 @@
    @RequestMapping(value = "/getMgtShopTag", method = RequestMethod.POST)
    @ApiOperation(value = "获取商户标签")
    public R<List<MgtShopTagVo>> getMgtShopTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
        List<MgtShopTagVo> mgtShopInfoVoList = shopRelTagService.listShopTagVo(Long.valueOf(mgtBaseGetDto.getId()));
        List<MgtShopTagVo> mgtShopInfoVoList = shopRelTagService.listShopTagVo(mgtBaseGetDto);
        return R.ok(mgtShopInfoVoList);
    }
@@ -107,6 +118,61 @@
        return R.ok();
    }
    @RequestMapping(value = "/pageMgtShopSuggest", method = RequestMethod.POST)
    @ApiOperation(value = "平台获取商户建议列表")
    public R<Page<MgtShopSuggestPageVo>> pageMgtShopSuggest(@RequestBody MgtShopSuggestPageDto mgtShopSuggestPageDto) {
        Long userId = SecurityUtils.getUserId();
        mgtShopSuggestPageDto.setUserId(userId);
        Page<MgtShopSuggestPageVo> page = new Page<>();
        page.setSize(mgtShopSuggestPageDto.getPageSize());
        page.setCurrent(mgtShopSuggestPageDto.getPageNum());
        List<MgtShopSuggestPageVo> mgtShopSuggestPageVoList = shopSuggestService.pageMgtShopSuggest(page,mgtShopSuggestPageDto);
        return R.ok(page.setRecords(mgtShopSuggestPageVoList));
    }
    @RequestMapping(value = "/mgtReplayShopSuggest", method = RequestMethod.POST)
    @ApiOperation(value = "平台回复会员建议")
    public R mgtReplayShopSuggest(@RequestBody MgtReplayShopSuggestDto mgtReplayShopSuggestDto) {
        Long userId = SecurityUtils.getUserId();
        mgtReplayShopSuggestDto.setUserId(userId);
        shopSuggestService.mgtReplayShopSuggest(mgtReplayShopSuggestDto);
        return R.ok();
    }
    @RequestMapping(value = "/listMgtShopSuggestTag", method = RequestMethod.POST)
    @ApiOperation(value = "获取商户建议标签")
    public R<List<MgtShopSuggestTagVo>> listMgtShopSuggestTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
        List<MgtShopSuggestTagVo> mgtShopSuggestTagVoList = shopSuggestService.listMgtShopSuggestTag(Long.valueOf(mgtBaseGetDto.getId()));
        return R.ok(mgtShopSuggestTagVoList);
    }
    @RequestMapping(value = "/mgtEditShopSuggestTag", method = RequestMethod.POST)
    @ApiOperation(value = "平台编辑会员建议标签")
    public R mgtEditShopSuggestTag(@RequestBody MgtTagShopSuggestDto mgtTagShopSuggestDto) {
        Long userId = SecurityUtils.getUserId();
        mgtTagShopSuggestDto.setUserId(userId);
        shopSuggestService.mgtEditShopSuggestTag(mgtTagShopSuggestDto);
        return R.ok();
    }
    @RequestMapping(value = "/pageMgtShopCertificate", method = RequestMethod.POST)
    @ApiOperation(value = "平台获取商户证书审核列表")
    public R<Page<MgtShopCertificatePageVo>> pageMgtShopCertificate(@RequestBody MgtShopCertificatePageDto mgtShopCertificatePageDto) {
        Long userId = SecurityUtils.getUserId();
        mgtShopCertificatePageDto.setUserId(userId);
        Page<MgtShopCertificatePageVo> page = new Page<>();
        page.setSize(mgtShopCertificatePageDto.getPageSize());
        page.setCurrent(mgtShopCertificatePageDto.getPageNum());
        List<MgtShopCertificatePageVo> mgtShopCertificatePageVoList = shopCertificateService.pageMgtShopCertificate(page,mgtShopCertificatePageDto);
        return R.ok(page.setRecords(mgtShopCertificatePageVoList));
    }
    @RequestMapping(value = "/mgtAuditShopCertificate", method = RequestMethod.POST)
    @ApiOperation(value = "平台编辑会员建议标签")
    public R mgtAuditShopCertificate(@RequestBody MgtAuditShopCertificateDto mgtAuditShopCertificateDto) {
        Long userId = SecurityUtils.getUserId();
        mgtAuditShopCertificateDto.setUserId(userId);
        shopCertificateService.mgtAuditShopCertificate(mgtAuditShopCertificateDto);
        return R.ok();
    }
}