diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 8bd74a2c52..a7396f195e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -578,5 +578,5 @@ public interface GovOrgOpenFeignClient { Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO); @PostMapping("/gov/org/customergrid/getstaffgridlist") - Result> getStaffGridList(@RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType); + Result> getStaffGridList(@RequestParam("customerId") String customerId, @RequestParam("orgId") String orgId, @RequestParam("orgType") String orgType); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 9aeea0c92b..d44f401c9a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -371,7 +371,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result> getStaffGridList(String orgId, String orgType) { + public Result> getStaffGridList(String customerId, String orgId, String orgType) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", orgId, orgType); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index ee4afd7bc8..34628a197f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -17,10 +17,8 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -333,15 +331,15 @@ public class CustomerGridController { } /** - * @Description 【事件】社区服务热线 + * @Description 获取工作人员所在的网格列表 * @author sun **/ @PostMapping("getstaffgridlist") - Result> getStaffGridList(@LoginUser TokenDto tokenDto, + Result> getStaffGridList(@RequestParam("customerId")String customerId, @RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType) { //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); - List staffGridList = customerGridService.getStaffGridList(tokenDto.getCustomerId(), orgId, orgType); + List staffGridList = customerGridService.getStaffGridList(customerId, orgId, orgType); return new Result>().ok(staffGridList); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java index 43d5c8c49f..02d1d99ad2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java @@ -17,6 +17,7 @@ public class GridStaffFormDTO extends PageFormDTO { /** * 客户Id */ + @NotBlank(message = "客户Id不能为空", groups = {DefaultGroup.class}) private String customerId; /** @@ -43,10 +44,12 @@ public class GridStaffFormDTO extends PageFormDTO { /** * 组织ID */ + @NotBlank(message = "组织ID不能为空", groups = {DefaultGroup.class}) private String orgId; /** * 组织类型 agency or grid */ + @NotBlank(message = "组织类型不能为空", groups = {DefaultGroup.class}) private String orgType; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index a0bfcb4536..ee25f967f5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -2,11 +2,10 @@ package com.epmet.controller; import cn.hutool.core.collection.CollectionUtil; import com.epmet.commons.mybatis.entity.DataScope; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.*; @@ -14,6 +13,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -208,9 +208,13 @@ public class StaffRoleController { * @date 2022/1/17 2:26 下午 */ @PostMapping("getGridStaffList") - Result> getGridStaffList(@LoginUser TokenDto tokenDto, @RequestBody GridStaffFormDTO formDTO){ + Result> getGridStaffList(@RequestHeader("customerId") String customerId, @RequestBody GridStaffFormDTO formDTO){ //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); - formDTO.setCustomerId(tokenDto.getCustomerId()); + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(customerId); + } + ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); + return new Result>().ok(staffRoleService.getGridStaffList(formDTO)); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 700a7733a9..a13660a752 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -169,7 +169,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl(null,NumConstant.ZERO); } //继续查询 在网格里的人 - Result> staffGridResult = govOrgOpenFeignClient.getStaffGridList(formDTO.getOrgId(),formDTO.getOrgType()); + Result> staffGridResult = govOrgOpenFeignClient.getStaffGridList(formDTO.getCustomerId(),formDTO.getOrgId(),formDTO.getOrgType()); if (staffGridResult == null || !staffGridResult.success() || CollectionUtils.isEmpty(staffGridResult.getData())){ log.warn("getGridStaffList getStaffGridList return empty,param orgId:{},orgType:{}",formDTO.getOrgId(),formDTO.getOrgType()); return new PageData<>(null,NumConstant.ZERO);