From c00d0d3bc399b6648145dfd955cedbea90f5f99d Mon Sep 17 00:00:00 2001 From: jiangqs <343695869@qq.com> Date: 星期日, 18 六月 2023 17:38:22 +0800 Subject: [PATCH] 看板 --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 40 insertions(+), 12 deletions(-) diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java index c6a0eb7..db66de5 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java @@ -4,30 +4,29 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.shop.domain.dto.MerAgencyPageDto; -import com.ruoyi.shop.domain.dto.MerMemberTaskPageDto; import com.ruoyi.shop.domain.dto.MerShopCertificateEditDto; import com.ruoyi.shop.domain.dto.MerShopCertificateListDto; +import com.ruoyi.shop.domain.dto.MerShopSuggestDto; +import com.ruoyi.shop.domain.pojo.shop.ShopRelUser; import com.ruoyi.shop.domain.vo.MerAgencyPageVo; -import com.ruoyi.shop.domain.vo.MerMemberTaskPageVo; import com.ruoyi.shop.domain.vo.MerShopCertificateListVo; -import com.ruoyi.shop.domain.vo.MgtShopInfoVo; -import com.ruoyi.shop.service.shop.ShopCertificateService; -import com.ruoyi.shop.service.shop.ShopService; -import com.ruoyi.shop.service.shop.ShopStaffService; +import com.ruoyi.shop.domain.vo.MerShopSuggestVo; +import com.ruoyi.shop.service.shop.*; import com.ruoyi.system.api.domain.dto.MerBaseDto; import com.ruoyi.system.api.domain.dto.MerBaseGetDto; import com.ruoyi.system.api.domain.dto.MerEditUserDto; -import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; +import com.ruoyi.system.api.domain.dto.MerPageDto; +import com.ruoyi.system.api.domain.poji.shop.Shop; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; import com.ruoyi.system.api.domain.vo.MerStaffInfoVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; 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; /** @@ -43,14 +42,20 @@ public class MerShopController { - @Autowired + @Resource private ShopService shopService; - @Autowired + @Resource private ShopCertificateService shopCertificateService; - @Autowired + @Resource private ShopStaffService shopStaffService; + + @Resource + private ShopRelUserService shopRelUserService; + + @Resource + private ShopSuggestService shopSuggestService; /** * 未完成实际统计 @@ -105,7 +110,9 @@ @ApiOperation(value = "获取员工信息") public R<MerStaffInfoVo> getShopStaffInfo() { Long userId = SecurityUtils.getUserId(); - MerStaffInfoVo merStaffInfoVo = shopStaffService.getShopStaffInfo(userId); + ShopRelUser shopRelUser = shopRelUserService.getByUserId(userId); + Shop shop = shopService.getByShopId(shopRelUser.getShopId()); + MerStaffInfoVo merStaffInfoVo = shopStaffService.getShopStaffInfo(userId,shop); return R.ok(merStaffInfoVo); } @@ -113,10 +120,31 @@ @ApiOperation(value = "修改员工信息") public R editShopStaffInfo(@RequestBody MerEditUserDto merEditUserDto) { Long userId = SecurityUtils.getUserId(); + merEditUserDto.setUserId(userId); shopStaffService.editShopStaffInfo(merEditUserDto); return R.ok(); } + @RequestMapping(value = "/pageMerShopSuggest", method = RequestMethod.POST) + @ApiOperation(value = "分页获取商户建议") + public R<Page<MerShopSuggestVo>> pageMerShopSuggest(@RequestBody MerPageDto merPageDto) { + Long userId = SecurityUtils.getUserId(); + merPageDto.setUserId(userId); + Page<MerShopSuggestVo> page = new Page<>(); + page.setSize(merPageDto.getPageSize()); + page.setCurrent(merPageDto.getPageNum()); + List<MerShopSuggestVo> merShopSuggestVoList = shopSuggestService.pageMerShopSuggest(page,merPageDto); + return R.ok(page.setRecords(merShopSuggestVoList)); + } + + @RequestMapping(value = "/suggest", method = RequestMethod.POST) + @ApiOperation(value = "建议") + public R suggest(@RequestBody MerShopSuggestDto merShopSuggestDto) { + Long userId = SecurityUtils.getUserId(); + merShopSuggestDto.setUserId(userId); + shopSuggestService.suggest(merShopSuggestDto); + return R.ok(); + } } -- Gitblit v1.7.1