Browse Source

获取网格内工作人员

master
jianjun 4 years ago
parent
commit
8547d47c78
  1. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  3. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  4. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java
  5. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  6. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

2
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<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("orgId")String orgId, @RequestParam("orgType")String orgType);
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("customerId") String customerId, @RequestParam("orgId") String orgId, @RequestParam("orgType") String orgType);
}

2
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<List<CustomerStaffGridResultDTO>> getStaffGridList(String orgId, String orgType) {
public Result<List<CustomerStaffGridResultDTO>> getStaffGridList(String customerId, String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList", orgId, orgType);
}
}

8
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<List<CustomerStaffGridResultDTO>> getStaffGridList(@LoginUser TokenDto tokenDto,
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("customerId")String customerId,
@RequestParam("orgId")String orgId,
@RequestParam("orgType")String orgType) {
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
List<CustomerStaffGridResultDTO> staffGridList = customerGridService.getStaffGridList(tokenDto.getCustomerId(), orgId, orgType);
List<CustomerStaffGridResultDTO> staffGridList = customerGridService.getStaffGridList(customerId, orgId, orgType);
return new Result<List<CustomerStaffGridResultDTO>>().ok(staffGridList);
}

3
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;
}

12
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<PageData<CustomerGridStaffResultDTO>> getGridStaffList(@LoginUser TokenDto tokenDto, @RequestBody GridStaffFormDTO formDTO){
Result<PageData<CustomerGridStaffResultDTO>> 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<PageData<CustomerGridStaffResultDTO>>().ok(staffRoleService.getGridStaffList(formDTO));
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -169,7 +169,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
return new PageData<>(null,NumConstant.ZERO);
}
//继续查询 在网格里的人
Result<List<CustomerStaffGridResultDTO>> staffGridResult = govOrgOpenFeignClient.getStaffGridList(formDTO.getOrgId(),formDTO.getOrgType());
Result<List<CustomerStaffGridResultDTO>> 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);

Loading…
Cancel
Save