5 changed files with 175 additions and 0 deletions
			
			
		| @ -0,0 +1,4 @@ | |||||
|  | package com.epmet.dto.form; | ||||
|  | 
 | ||||
|  | public class ListOpePermsFormDTO { | ||||
|  | } | ||||
| @ -0,0 +1,64 @@ | |||||
|  | package com.epmet.feign.fallback; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.GovStaffRoleDTO; | ||||
|  | import com.epmet.dto.form.LatestGridFormDTO; | ||||
|  | import com.epmet.dto.form.StaffGridVisitedFormDTO; | ||||
|  | import com.epmet.dto.form.StaffRoleFormDTO; | ||||
|  | import com.epmet.dto.result.CustomerGridByUserIdResultDTO; | ||||
|  | import com.epmet.dto.result.LatestCustomerResultDTO; | ||||
|  | import com.epmet.feign.fallback.EpmetUserFeignClientFallback; | ||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||
|  | import org.springframework.http.MediaType; | ||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||
|  | import org.springframework.web.bind.annotation.PathVariable; | ||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | 
 | ||||
|  | import java.util.List; | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @Description | ||||
|  |  * @Author sun | ||||
|  |  */ | ||||
|  | //, url = "localhost:8087"
 | ||||
|  | @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) | ||||
|  | public interface EpmetUserFeignClient { | ||||
|  |     /** | ||||
|  |      * 获取最近一次登录的客户信息 | ||||
|  |      * | ||||
|  |      * @param userId | ||||
|  |      * @return | ||||
|  |      */ | ||||
|  |     @GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") | ||||
|  |     Result<LatestCustomerResultDTO> getLatestCustomer(@PathVariable("userId") String userId); | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * @Description 查询工作人员上次登录的网格 | ||||
|  |      * @Param customerId ; staffId | ||||
|  |      * @return Result<CustomerGridByUserIdResultDTO> | ||||
|  |      * @Author wangc | ||||
|  |      * @Date 2020.04.23 10:44 | ||||
|  |      **/ | ||||
|  |     @PostMapping(value = "/epmetuser/staffgridvisited/getstafflatestgrid") | ||||
|  |     Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * @param staffGridVisitedFormDTO | ||||
|  |      * @return com.epmet.commons.tools.utils.Result | ||||
|  |      * @Author yinzuomei | ||||
|  |      * @Description 保存网格访问记录 | ||||
|  |      * @Date 2020/4/23 13:27 | ||||
|  |      **/ | ||||
|  |     @PostMapping(value = "/epmetuser/staffgridvisited/savestaffgridvisitedrecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) | ||||
|  |     Result saveStaffGridVisitedRecord(@RequestBody StaffGridVisitedFormDTO staffGridVisitedFormDTO); | ||||
|  |     /** | ||||
|  |      * 查询工作人员的角色 | ||||
|  |      * @return | ||||
|  |      */ | ||||
|  |     @PostMapping("/epmetuser/staffrole/staffroles") | ||||
|  |     Result<List<GovStaffRoleDTO>> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); | ||||
|  | } | ||||
|  | 
 | ||||
| @ -0,0 +1,34 @@ | |||||
|  | package com.epmet.feign.fallback; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.CustomerAgencyDTO; | ||||
|  | import com.epmet.feign.fallback.GovOrgFeignClientFallBack; | ||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||
|  | import org.springframework.web.bind.annotation.PathVariable; | ||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @Description | ||||
|  |  * @Author sun | ||||
|  |  */ | ||||
|  | //, url = "localhost:8092"
 | ||||
|  | @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) | ||||
|  | public interface GovOrgFeignClient { | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 根据Id查询agency | ||||
|  |      * @param agencyId | ||||
|  |      * @return | ||||
|  |      */ | ||||
|  |     @PostMapping("/gov/org/agency/agencybyid/{agencyId}") | ||||
|  |     Result<CustomerAgencyDTO> getAgencyById(@PathVariable("agencyId") String agencyId); | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 根据staffId查询所属的组织机构 | ||||
|  |      * @param staffId | ||||
|  |      * @return | ||||
|  |      */ | ||||
|  |     @PostMapping("/gov/org/agency/agencybystaff/{staffId}") | ||||
|  |     Result<CustomerAgencyDTO> getAgencyByStaff(@PathVariable("staffId") String staffId); | ||||
|  | } | ||||
| @ -0,0 +1,42 @@ | |||||
|  | package com.epmet.feign.fallback; | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.ModuleUtils; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.GovStaffRoleDTO; | ||||
|  | import com.epmet.dto.form.LatestGridFormDTO; | ||||
|  | import com.epmet.dto.form.StaffGridVisitedFormDTO; | ||||
|  | import com.epmet.dto.form.StaffRoleFormDTO; | ||||
|  | import com.epmet.dto.result.CustomerGridByUserIdResultDTO; | ||||
|  | import com.epmet.dto.result.LatestCustomerResultDTO; | ||||
|  | import com.epmet.feign.EpmetUserFeignClient; | ||||
|  | import org.springframework.stereotype.Component; | ||||
|  | 
 | ||||
|  | import java.util.List; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @Description | ||||
|  |  * @Author sun | ||||
|  |  */ | ||||
|  | @Component | ||||
|  | public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { | ||||
|  | 
 | ||||
|  |     @Override | ||||
|  |     public Result<LatestCustomerResultDTO> getLatestCustomer(String userId) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); | ||||
|  |     } | ||||
|  | 
 | ||||
|  |     @Override | ||||
|  |     public Result<List<GovStaffRoleDTO>> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff"); | ||||
|  |     } | ||||
|  |     @Override | ||||
|  |     public Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffLatestGrid",latestGridFormDTO); | ||||
|  |     } | ||||
|  |     @Override | ||||
|  |     public Result saveStaffGridVisitedRecord(StaffGridVisitedFormDTO staffGridVisitedFormDTO) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffGridVisitedRecord", staffGridVisitedFormDTO); | ||||
|  |     } | ||||
|  | } | ||||
| @ -0,0 +1,31 @@ | |||||
|  | package com.epmet.feign.fallback; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.ModuleUtils; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.CustomerAgencyDTO; | ||||
|  | import com.epmet.dto.form.LatestGridFormDTO; | ||||
|  | import com.epmet.dto.result.CustomerGridByUserIdResultDTO; | ||||
|  | import com.epmet.dto.result.LatestCustomerResultDTO; | ||||
|  | import com.epmet.feign.GovOrgFeignClient; | ||||
|  | import org.springframework.stereotype.Component; | ||||
|  | 
 | ||||
|  | import java.util.List; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @Description | ||||
|  |  * @Author sun | ||||
|  |  */ | ||||
|  | @Component | ||||
|  | public class GovOrgFeignClientFallBack implements GovOrgFeignClient { | ||||
|  | 
 | ||||
|  |     @Override | ||||
|  |     public Result<CustomerAgencyDTO> getAgencyById(String agencyId) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyById", agencyId); | ||||
|  |     } | ||||
|  | 
 | ||||
|  |     @Override | ||||
|  |     public Result<CustomerAgencyDTO> getAgencyByStaff(String staffId) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); | ||||
|  |     } | ||||
|  | } | ||||
					Loading…
					
					
				
		Reference in new issue