jiangqs
2023-08-06 431dde90aa20f7652092fc0bfa9e6a1a28b06b9f
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java
@@ -13,6 +13,7 @@
import com.ruoyi.system.api.domain.vo.MgtSimpleShopVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -68,10 +69,12 @@
    @RequestMapping(value = "/exportPageMgtShop", method = RequestMethod.POST)
    @ApiOperation(value = "导出商户列表")
    public void exportPageMgtShop(@RequestBody MgtShopPageDto mgtShopPageDto, HttpServletResponse response) {
    public void exportPageMgtShop(MgtShopPageDto mgtShopPageDto, HttpServletResponse response) {
        Page<MgtShopPageVo> page = new Page<>();
        page.setSize(2000);
        page.setCurrent(1);
        if(page.getSize()>5000){
            page.setSize(5000);
            page.setCurrent(1);
        }
        List<MgtShopPageVo> mgtShopPageVoList = shopService.pageMgtShop(page,mgtShopPageDto);
        ExcelUtil<MgtShopPageVo> util = new ExcelUtil<MgtShopPageVo>(MgtShopPageVo.class);
        util.exportExcel(response, mgtShopPageVoList, "用户订单列表");
@@ -80,7 +83,7 @@
    @RequestMapping(value = "/createMgtShop", method = RequestMethod.POST)
    @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "编辑商户")
    @ApiOperation(value = "平台编辑商户")
    public R createMgtShop(@RequestBody MgtEditShopDto mgtEditShopDto) {
    public R createMgtShop(@Validated @RequestBody MgtEditShopDto mgtEditShopDto) {
        Long userId = SecurityUtils.getUserId();
        mgtEditShopDto.setUserId(userId);
        shopService.createShop(mgtEditShopDto);
@@ -109,6 +112,14 @@
        return R.ok();
    }
    @RequestMapping(value = "/transferMgtShop", method = RequestMethod.POST)
    @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "转移客户")
    @ApiOperation(value = "转移客户")
    public R transferMgtShop(@RequestBody MgtTransferShopDto mgtTransferShopDto) {
        shopService.transferMgtShop(mgtTransferShopDto);
        return R.ok();
    }
    @RequestMapping(value = "/terminateMgtCooperation", method = RequestMethod.POST)
    @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "终止合作")
    @ApiOperation(value = "终止合作")
@@ -116,6 +127,16 @@
        Long userId = SecurityUtils.getUserId();
        mgtTerminateCooperationDto.setUserId(userId);
        shopService.terminateMgtCooperation(mgtTerminateCooperationDto);
        return R.ok();
    }
    @RequestMapping(value = "/frozenMgtShop", method = RequestMethod.POST)
    @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "终止合作")
    @ApiOperation(value = "冻结商户")
    public R frozenMgtShop(@RequestBody MgtFrozenShopDto mgtFrozenShopDto) {
        Long userId = SecurityUtils.getUserId();
        mgtFrozenShopDto.setUserId(userId);
        shopService.frozenMgtShop(mgtFrozenShopDto);
        return R.ok();
    }
@@ -162,12 +183,14 @@
    @RequestMapping(value = "/exportPageMgtShopSuggest", method = RequestMethod.POST)
    @ApiOperation(value = "导出商户建议列表")
    public void exportPageMgtShopSuggest(@RequestBody MgtShopSuggestPageDto mgtShopSuggestPageDto, HttpServletResponse response) {
    public void exportPageMgtShopSuggest(MgtShopSuggestPageDto mgtShopSuggestPageDto, HttpServletResponse response) {
        Long userId = SecurityUtils.getUserId();
        mgtShopSuggestPageDto.setUserId(userId);
        Page<MgtShopSuggestPageVo> page = new Page<>();
        page.setSize(2000);
        page.setCurrent(1);
        if(page.getSize()>5000){
            page.setSize(5000);
            page.setCurrent(1);
        }
        List<MgtShopSuggestPageVo> mgtShopSuggestPageVoList = shopSuggestService.pageMgtShopSuggest(page,mgtShopSuggestPageDto);
        ExcelUtil<MgtShopSuggestPageVo> util = new ExcelUtil<MgtShopSuggestPageVo>(MgtShopSuggestPageVo.class);
        util.exportExcel(response, mgtShopSuggestPageVoList, "商户建议列表");
@@ -245,7 +268,7 @@
    @RequestMapping(value = "/mgtShopAuth", method = RequestMethod.POST)
    @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户进件")
    @ApiOperation(value = "平台商户进件")
    public R mgtShopAuth(@RequestBody MgtShopAuthDto mgtShopAuthDto) {
    public R mgtShopAuth(@Validated @RequestBody MgtShopAuthDto mgtShopAuthDto) throws Exception {
        Long userId = SecurityUtils.getUserId();
        mgtShopAuthDto.setUserId(userId);
        shopService.mgtShopAuth(mgtShopAuthDto);
@@ -265,4 +288,6 @@
        MgtShopAuthCodeVo mgtShopAuthCodeVo = shopService.getMgtShopAuthCode(mgtShopAuthGetDto.getAuthId());
        return R.ok(mgtShopAuthCodeVo);
    }
}