From fdfc7a2111ab9316a2548f7fe1b2a7c7a10f9487 Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Thu, 12 Aug 2021 11:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise/EnterpriseCountController.java | 36 +++++++++++++++++-- .../mapper/enterprise/enterprise-mapper.xml | 8 ++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java b/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java index 36ebdab..c8fc7d0 100644 --- a/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java +++ b/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java @@ -2,12 +2,16 @@ package com.cm.inspection.controller.app.resources.enterprise; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.oauth.service.group.IGroupService; +import com.cm.common.plugin.pojo.bos.UserResourceBO; import com.cm.common.pojo.ListPage; +import com.cm.common.pojo.bos.GroupBO; import com.cm.common.result.SuccessResultList; import com.cm.inspection.controller.app.resources.BigDataResult; import com.cm.inspection.enums.enterpriseTypeEnum; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.service.enterprise.IEnterpriseService; +import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -28,8 +32,10 @@ public class EnterpriseCountController extends AbstractController { @Autowired private IEnterpriseService enterpriseService; - - + @Autowired + private IGroupService groupService; + @Autowired + private IEnterpriseOfGridOperatorService eoosService; @ApiOperation(value = "统计企业类型", notes = "统计企业类型接口") @GetMapping("count-enterprisetype") @@ -110,12 +116,38 @@ public class EnterpriseCountController extends AbstractController { @GetMapping("enterprise-list") public SuccessResultList>> enterpriseList(ListPage page){ Map params = requestParams(); + if(params.get("groupId") != null){ + List userId = new ArrayList<>(); + List userList = groupService.listUser(params.get("groupId").toString()); + for (UserResourceBO userResourceBO : userList) { + userId.add(userResourceBO.getUserId()); + } + List enterpriseIds = eoosService.listEnterpriseIdOfUserIds(userId); + params.put("enterpriseIds",enterpriseIds); + } page.setParams(params); + SuccessResultList>> listSuccessResultList = enterpriseService.listPageBigData(page); return listSuccessResultList; } + @ApiOperation(value = "获取人员分组", notes = "获取人员分组接口") + @GetMapping("get-group-list") + public BigDataResult getGroupList(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + List groupBOList = groupService.list("0"); + for (GroupBO groupBO : groupBOList) { + Map params = new HashMap<>(); + params.put("id",groupBO.getGroupId()); + params.put("name",groupBO.getGroupName()); + list.add(params); + } + result.setList(list); + return result; + } + diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index b3f1f16..0b4b471 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -837,7 +837,13 @@ AND t2.enterprise_type = #{enterpriseType} - + + AND + t1.enterprise_id IN + + #{enterpriseIds[${index}]} + +