8 changed files with 212 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||
package com.elink.esua.epdc.dto.epdc; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门节点 |
|||
* |
|||
* @author work@yujt.net.cn |
|||
* @date 2019/11/27 10:03 |
|||
*/ |
|||
@Data |
|||
public class DeptCodeOption<T> { |
|||
|
|||
private List<T> options; |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.admin.DeptAddAreaCodeFormDTO; |
|||
import com.elink.esua.epdc.dto.admin.DeptAddAreaCodeResultDTO; |
|||
import com.elink.esua.epdc.dto.admin.DeptCodeFormDTO; |
|||
import com.elink.esua.epdc.dto.epdc.DeptCodeOption; |
|||
import com.elink.esua.epdc.feign.fallback.AnalysisFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* 数据分析模块调用 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/9 15:41 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = AnalysisFeignClientFallback.class) |
|||
public interface AnalysisFeignClient { |
|||
|
|||
/** |
|||
* @Description 组织机构编码获取 |
|||
* @Author songyunpeng |
|||
* @Date 2021/1/7 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
**/ |
|||
@GetMapping(value = "analysis/admin/getDeptCode", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<DeptCodeOption> getDeptCode(@RequestBody DeptCodeFormDTO deptCodeFormDTO); |
|||
|
|||
/** |
|||
* 新增区域编码 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.admin.DeptAddAreaCodeResultDTO> |
|||
* @author Liuchuang |
|||
* @since 2021/5/11 15:38 |
|||
*/ |
|||
@PostMapping(value = "analysis/admin/addAreaCode", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<DeptAddAreaCodeResultDTO> addAreaCode(DeptAddAreaCodeFormDTO formDto); |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.admin.DeptAddAreaCodeFormDTO; |
|||
import com.elink.esua.epdc.dto.admin.DeptAddAreaCodeResultDTO; |
|||
import com.elink.esua.epdc.dto.admin.DeptCodeFormDTO; |
|||
import com.elink.esua.epdc.dto.epdc.DeptCodeOption; |
|||
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author:songyunpeg |
|||
* @Date:2020/9/9 15:42 |
|||
*/ |
|||
@Component |
|||
public class AnalysisFeignClientFallback implements AnalysisFeignClient { |
|||
|
|||
|
|||
@Override |
|||
public Result<DeptCodeOption> getDeptCode(DeptCodeFormDTO deptCodeFormDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "getDeptCode",deptCodeFormDTO); |
|||
} |
|||
|
|||
@Override |
|||
public Result<DeptAddAreaCodeResultDTO> addAreaCode(DeptAddAreaCodeFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "addAreaCode",formDto); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.dto.admin; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Liuchuang |
|||
*/ |
|||
@Data |
|||
public class DeptAddAreaCodeFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -8154207132241940362L; |
|||
|
|||
/** |
|||
* 上级组织区域编码 |
|||
*/ |
|||
@NotBlank(message = "上级组织区域编码不能为空") |
|||
private String parentAreaCode; |
|||
|
|||
/** |
|||
* 新增组织名称 |
|||
*/ |
|||
@NotBlank(message = "新增组织名称不能为空") |
|||
private String name; |
|||
|
|||
/** |
|||
* 新增组织区域编码,如果code有值,会更新行政区划的名字。 |
|||
*/ |
|||
private String code; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.elink.esua.epdc.dto.admin; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Liuchuang |
|||
*/ |
|||
@Data |
|||
public class DeptAddAreaCodeResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 8182151134618271181L; |
|||
|
|||
/** |
|||
* 区域编码 |
|||
*/ |
|||
private String code; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.dto.admin; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author songyunpeng |
|||
* @Description 获取行政区域编码参数 |
|||
* @create 2021-01-07 |
|||
*/ |
|||
@Data |
|||
public class DeptCodeFormDTO implements Serializable { |
|||
|
|||
/** |
|||
* 部门区域编码 |
|||
*/ |
|||
private String rootAreaCode; |
|||
|
|||
|
|||
/** |
|||
* 部门区域级别 |
|||
*/ |
|||
private String rootAreaLevel; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.dto.admin; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author songyunpeng |
|||
* @Description |
|||
* @create 2021-01-07 |
|||
*/ |
|||
@Data |
|||
public class DeptCodeTree implements Serializable { |
|||
|
|||
/** |
|||
* 部门区域编码 |
|||
*/ |
|||
private String code; |
|||
/** |
|||
* 部门区域编码 |
|||
*/ |
|||
private String parentCode; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 下一级 |
|||
*/ |
|||
private List<DeptCodeTree> children; |
|||
|
|||
|
|||
|
|||
} |
Loading…
Reference in new issue