Browse Source

ext-plugin

master
wangchao 5 years ago
parent
commit
6d3d1f4e6a
  1. 48
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java
  2. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  3. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  5. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  6. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

48
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java

@ -1,17 +1,17 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffSinAgencyResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.StaffSinDeptResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.dto.result.StaffSinGridResultDTO; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.OpenUpService; import com.epmet.service.OpenUpService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -26,6 +26,10 @@ public class OpenUpController {
@Autowired @Autowired
private OpenUpService openUpService; private OpenUpService openUpService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/** /**
* @Description 网格工作人员 被禁用的未激活的不显示 * @Description 网格工作人员 被禁用的未激活的不显示
@ -63,4 +67,34 @@ public class OpenUpController {
return new Result<List<StaffSinAgencyResultDTO>>().ok(openUpService.staffSinAgency(formDTO)); return new Result<List<StaffSinAgencyResultDTO>>().ok(openUpService.staffSinAgency(formDTO));
} }
/**
* @Description 查找工作人员的信息
* @param
* @return
* @author wangc
* @date 2020.08.17 10:30
**/
//@ExternalAppRequestAuth
@PostMapping("staffinfo")
public Result<ExtStaffInfoResultDTO> staffInfo(@LoginUser TokenDto token){
CommonStaffIdFormDTO commonStaffIdFormDTO = new CommonStaffIdFormDTO();
commonStaffIdFormDTO.setStaffId(token.getUserId());
ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class);
return epmetUserOpenFeignClient.extStaffInfo(commonStaffIdFormDTO);
}
/**
* @Description 根据staffId查询当前这个用户的数据权限
* @param
* @return
* @author wangc
* @date 2020.08.17 17:30
**/
//@ExternalAppRequestAuth
@PostMapping("permission")
Result<ExtStaffPermissionResultDTO> staffPermissionExt(@RequestBody CommonStaffIdFormDTO commonStaffIdFormDTO){
ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class);
return govOrgOpenFeignClient.staffPermissionExt(commonStaffIdFormDTO.getStaffId());
}
} }

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -19,8 +19,8 @@ import java.util.List;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37 * @date 2020/6/4 13:37
*/ */
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) //@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class)
public interface GovOrgOpenFeignClient { public interface GovOrgOpenFeignClient {
/** /**
@ -230,4 +230,14 @@ public interface GovOrgOpenFeignClient {
**/ **/
@PostMapping("/gov/org/customeragency/staffinfoext") @PostMapping("/gov/org/customeragency/staffinfoext")
Result<ExtStaffInfoResultDTO> staffInfoExt(@RequestBody ExtStaffInfoResultDTO result); Result<ExtStaffInfoResultDTO> staffInfoExt(@RequestBody ExtStaffInfoResultDTO result);
/**
* @Description 根据staffId查询当前这个用户的数据权限对外接口
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 17:30
**/
@PostMapping("/gov/org/customeragency/permissionext/{staffId}")
Result<ExtStaffPermissionResultDTO> staffPermissionExt(@PathVariable(value = "staffId") String staffId);
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -136,4 +136,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<ExtStaffInfoResultDTO> staffInfoExt(ExtStaffInfoResultDTO result) { public Result<ExtStaffInfoResultDTO> staffInfoExt(ExtStaffInfoResultDTO result) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffInfoExt", result); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffInfoExt", result);
} }
@Override
public Result<ExtStaffPermissionResultDTO> staffPermissionExt(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffPermissionExt", staffId);
}
} }

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -175,7 +175,7 @@
gridd.GRID_NAME, gridd.GRID_NAME,
agency.ID AS agencyId, agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName, agency.ORGANIZATION_NAME AS agencyName,
agency.PID AS agencyIdPath, agency.PIDS AS agencyIdPath,
agency.ALL_PARENT_NAME AS agencyNamePath, agency.ALL_PARENT_NAME AS agencyNamePath,
agency.CUSTOMER_ID AS customerId agency.CUSTOMER_ID AS customerId
FROM FROM

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -198,4 +198,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result updateRootManage(UpdateRootManageFormDTO formDTO) { public Result updateRootManage(UpdateRootManageFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO);
} }
@Override
public Result<ExtStaffInfoResultDTO> extStaffInfo(CommonStaffIdFormDTO staffParam) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extStaffInfo", staffParam);
}
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -342,7 +342,7 @@ public class CustomerStaffController {
* @date 2020.08.17 10:30 * @date 2020.08.17 10:30
**/ **/
@PostMapping("extstaffinfo") @PostMapping("extstaffinfo")
public Result<ExtStaffInfoResultDTO> extStaffInfo(CommonStaffIdFormDTO staffParam){ public Result<ExtStaffInfoResultDTO> extStaffInfo(@RequestBody CommonStaffIdFormDTO staffParam){
ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class); ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class);
return new Result<ExtStaffInfoResultDTO>().ok(customerStaffService.extStaffInfo(staffParam)); return new Result<ExtStaffInfoResultDTO>().ok(customerStaffService.extStaffInfo(staffParam));
} }

Loading…
Cancel
Save