29 changed files with 580 additions and 8 deletions
			
			
		@ -0,0 +1,28 @@ | 
				
			|||
package com.epmet.dto.feign; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.constant.ServiceConstant; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; | 
				
			|||
import com.epmet.dto.result.ArticleGridResultDTO; | 
				
			|||
import org.springframework.cloud.openfeign.FeignClient; | 
				
			|||
import org.springframework.http.MediaType; | 
				
			|||
import org.springframework.web.bind.annotation.PathVariable; | 
				
			|||
import org.springframework.web.bind.annotation.PostMapping; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description gov-org服务 | 
				
			|||
 * @Author sun | 
				
			|||
 */ | 
				
			|||
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgSelfFeignClientFallBack.class) | 
				
			|||
public interface GovOrgSelfFeignClient { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @param staffId | 
				
			|||
     * @return | 
				
			|||
     * @Author sun | 
				
			|||
     * @Description 党建声音-政府端-可选发布范围接口调用 | 
				
			|||
     **/ | 
				
			|||
    @PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) | 
				
			|||
    Result<ArticleGridResultDTO> getAgencyGridList(@PathVariable("staffId") String staffId); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,21 @@ | 
				
			|||
package com.epmet.dto.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.feign.GovOrgSelfFeignClient; | 
				
			|||
import com.epmet.dto.result.ArticleGridResultDTO; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description gov-org服务 | 
				
			|||
 * @Author sun | 
				
			|||
 */ | 
				
			|||
@Component | 
				
			|||
public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public Result<ArticleGridResultDTO> getAgencyGridList(String staffId) { | 
				
			|||
        return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,41 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 党建声音-可选发布范围-接口返参 | 
				
			|||
 * | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class AgencyGridListResultDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 机关组织Id | 
				
			|||
     */ | 
				
			|||
    private String gridId = ""; | 
				
			|||
    private String gridName = ""; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,57 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 党建声音-可选发布范围-接口返参 | 
				
			|||
 * | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ArticleGridResultDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 机关组织Id | 
				
			|||
     */ | 
				
			|||
    private String agencyId = ""; | 
				
			|||
    /** | 
				
			|||
     * 机关组织名称 | 
				
			|||
     */ | 
				
			|||
    private String agencyName = ""; | 
				
			|||
    /** | 
				
			|||
     * 当前机关的下属网格列表 | 
				
			|||
     */ | 
				
			|||
    private List<AgencyGridListResultDTO> gridList; | 
				
			|||
    /** | 
				
			|||
     * 当前组织的所有下级组织信息(递归) | 
				
			|||
     */ | 
				
			|||
    private List<ArticleGridResultDTO> subAgencyGridList; | 
				
			|||
    /** | 
				
			|||
     * 所有上级机关Ids | 
				
			|||
     */ | 
				
			|||
    private String pids = ""; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,26 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 查询客户下人员拥有的角色列表-接口入参 | 
				
			|||
 * @Author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class CustomerStaffRoleListFormDTO implements Serializable{ | 
				
			|||
    private static final long serialVersionUID = -7994579456530273809L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     * */ | 
				
			|||
    private String customerId; | 
				
			|||
    /** | 
				
			|||
     * 用户Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "用户Id不能为空") | 
				
			|||
    private String staffId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,41 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 根据客户Id staffId查询人员在客户下的角色列表-接口返参 | 
				
			|||
 * @Author sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class CustomerStaffRoleListResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -2049883620062097446L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     * */ | 
				
			|||
    private String customerId; | 
				
			|||
    /** | 
				
			|||
     * 员工Id | 
				
			|||
     * */ | 
				
			|||
    private String staffId; | 
				
			|||
    /** | 
				
			|||
     * 员工姓名 | 
				
			|||
     * */ | 
				
			|||
    private String staffName; | 
				
			|||
    /** | 
				
			|||
     * 角色Id | 
				
			|||
     * */ | 
				
			|||
    private String roleId; | 
				
			|||
    /** | 
				
			|||
     * 角色Key | 
				
			|||
     * */ | 
				
			|||
    private String roleKey; | 
				
			|||
    /** | 
				
			|||
     * 角色名称 | 
				
			|||
     * */ | 
				
			|||
    private String roleName; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,29 @@ | 
				
			|||
package com.epmet.feign; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.constant.ServiceConstant; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.form.CustomerStaffRoleListFormDTO; | 
				
			|||
import com.epmet.dto.result.CustomerStaffRoleListResultDTO; | 
				
			|||
import com.epmet.feign.fallback.EpmetUserSelfFeignClientFallBack; | 
				
			|||
import org.springframework.cloud.openfeign.FeignClient; | 
				
			|||
import org.springframework.web.bind.annotation.PostMapping; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @dscription epmet-user服务 | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserSelfFeignClientFallBack.class) | 
				
			|||
public interface EpmetUserSelfFeignClient { | 
				
			|||
 | 
				
			|||
	/** | 
				
			|||
	 * @param formDTO | 
				
			|||
	 * @return | 
				
			|||
	 * @Author sun | 
				
			|||
	 * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 | 
				
			|||
	 **/ | 
				
			|||
    @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") | 
				
			|||
	Result<List<CustomerStaffRoleListResultDTO>> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,24 @@ | 
				
			|||
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.form.CustomerStaffRoleListFormDTO; | 
				
			|||
import com.epmet.dto.result.CustomerStaffRoleListResultDTO; | 
				
			|||
import com.epmet.feign.EpmetUserSelfFeignClient; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @dscription epmet-user服务 | 
				
			|||
 * @author sun | 
				
			|||
 */ | 
				
			|||
@Component | 
				
			|||
public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClient { | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public Result<List<CustomerStaffRoleListResultDTO>> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { | 
				
			|||
        return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue