From c4558ef096db556d234bf04fe797dc2d17ec13ee Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期二, 20 八月 2024 19:12:13 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java index f612c11..4881695 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEnterpriseUserApplicationController.java @@ -1,6 +1,9 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.account.api.dto.EnterpriseQuery; +import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; @@ -10,10 +13,10 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -29,6 +32,8 @@ private final TEnterpriseUserApplicationService enterpriseUserApplicationService; private final TokenService tokenService; + @Resource + private AppUserClient appUserClient; @Autowired public TEnterpriseUserApplicationController(TEnterpriseUserApplicationService enterpriseUserApplicationService, TokenService tokenService) { @@ -40,7 +45,7 @@ * 添加计费策略管理 */ @Log(title = "添加集团用户申请", businessType = BusinessType.INSERT) - @ApiOperation(tags = {"小程序-计费策略"},value = "添加集团用户申请") + @ApiOperation(tags = {"小程序-集团用户","后台-申请表单-集团用户"},value = "添加集团用户申请") @PostMapping(value = "/add") public AjaxResult<Boolean> add(@Validated @RequestBody TEnterpriseUserApplication dto) { // 用户id @@ -49,13 +54,43 @@ } - @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表") @PostMapping(value = "/page") - public AjaxResult<Boolean> page(@RequestBody TEnterpriseUserApplication dto) { + public AjaxResult<Page<TEnterpriseUserApplication>> page(EnterpriseQuery enterpriseQuery) { // 用户id - dto.setAppUserId(tokenService.getLoginUserApplet().getUserId()); - return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); + if (enterpriseQuery.getPhone()!=null) { + List<Long> userIds = appUserClient.getUserIdsByPhone(enterpriseQuery.getPhone()).getData(); + if (userIds.isEmpty()){ + return AjaxResult.warn("未查询到用户"); + } + Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().in(TEnterpriseUserApplication::getAppUserId, userIds).page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); + return AjaxResult.ok(page); + }else { + Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); + return AjaxResult.ok(page); + } + } + + + @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") + @GetMapping(value = "/remark") + public AjaxResult pass(Integer id,String remark) { + // 用户id + TEnterpriseUserApplication byId = enterpriseUserApplicationService.getById(id); + byId.setRemark(remark); + enterpriseUserApplicationService.updateById(byId); + return AjaxResult.success(); + } + + @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") + @DeleteMapping(value = "/delete") + public AjaxResult delete(String ids) { + String[] split = ids.split(","); + for (String s : split) { + enterpriseUserApplicationService.removeById(s); + } + return AjaxResult.success(); + } } -- Gitblit v1.7.1