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 c8fc7d0..f7c112d 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 @@ -122,8 +122,15 @@ public class EnterpriseCountController extends AbstractController { for (UserResourceBO userResourceBO : userList) { userId.add(userResourceBO.getUserId()); } - List enterpriseIds = eoosService.listEnterpriseIdOfUserIds(userId); - params.put("enterpriseIds",enterpriseIds); + if(userId.size() > 0){ + List enterpriseIds = eoosService.listEnterpriseIdOfUserIds(userId); + params.put("enterpriseIds",enterpriseIds); + }else{ + List enterpriseIdNull = new ArrayList<>(); + enterpriseIdNull.add("11"); + params.put("enterpriseIds",enterpriseIdNull); + } + } page.setParams(params); diff --git a/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java b/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java index b099339..bdd75b2 100644 --- a/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java +++ b/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java @@ -39,6 +39,8 @@ public class enterpriseofgridoperatorCountController extends AbstractController private IEnterpriseOfGridOperatorService ieoService; @Autowired private IGridPersonnelService gridPersonnelService; + @Autowired + private IEnterpriseOfGridOperatorService eoosService; @@ -90,6 +92,14 @@ public class enterpriseofgridoperatorCountController extends AbstractController @GetMapping("listpage") public SuccessResultList> listPage(ListPage page) throws SearchException, UnsupportedEncodingException { 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()); + } + params.put("groupUserIds",userId); + } page.setParams(params); return gridPersonnelService.listPage(page); } diff --git a/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml b/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml index 903a176..905589f 100644 --- a/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml +++ b/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml @@ -264,6 +264,12 @@ t1.user_id = #{userIds[${index}]} + + AND + + t1.user_id = #{groupUserIds[${index}]} + + AND t1.level = #{level}