Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c9e832f6
authored
Oct 19, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(调用bena接口定义): IBeanRemoteService
1 parent
f146707b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
295 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/AccessToken.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BeanAccountInfo.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BeanR.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BranchRes.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/Department.java
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
;
import
com.dituhui.pea.order.feign.bean.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 调用Bean接口
*/
@FeignClient
(
url
=
"${bean.server}"
,
name
=
"beanRemoteService"
)
public
interface
IBeanRemoteService
{
/**
* 接口调用的accessToken获取。
*
* @param requestParam 请求参数
* @return accessToken 以及过期时间
* @apiNote 调用BEAN系统Api接口时需要先获取accessToken,放入header中用于验证。
*/
@PostMapping
(
"/api/openapi/service/auth/get_access_token"
)
BeanR
<
AccessToken
.
Result
>
getAccessToken
(
@RequestBody
AccessToken
.
Request
requestParam
);
/**
* 通过部门ids获取部门列表信息,如果不传入部门ids则获取全部。
*
* @param accessToken ACCESS_TOKEN
* @return BEAN组织架构部门信息
* @apiNote BEAN提供批量获取BEAN组织架构部门信息的接口,提供的字段包括:部门名称、部门ID、父部门ID、子部门ID列表等
*/
@GetMapping
(
"/api/openapi/department/detail"
)
BeanR
<
Department
>
departmentDetail
(
@RequestHeader
(
name
=
"accessToken"
)
String
accessToken
,
@RequestParam
(
"id"
)
String
id
);
/**
* 查询BEAN维护的分部列表(大区-分部-分站&外围)
*
* @param accessToken ACCESS_TOKEN
* @return 部门列表
*/
@GetMapping
(
"/api/openapi/department/queryBranchList"
)
BeanR
<
List
<
BranchRes
>>
departmentBranchList
(
@RequestHeader
(
name
=
"accessToken"
)
String
accessToken
);
/**
* 获取人员列表
*
* @param accessToken ACCESS_TOKEN
* @param departmentId 部门Id,返回部门下所有用户(不包含子部门的用户)
* @return Bean 账号信息
* @apiNote BEAN提供批量获取BEAN账号信息的接口,提供字段包括:账号姓名、账号联系方式、所属部门等信息
*/
@GetMapping
(
"/api/openapi/user/queryList"
)
BeanR
<
List
<
BeanAccountInfo
>>
queryUserList
(
@RequestHeader
(
name
=
"accessToken"
)
String
accessToken
,
@RequestParam
(
"departmentId"
)
String
departmentId
);
}
project-order/src/main/java/com/dituhui/pea/order/feign/bean/AccessToken.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* AccessToken 请求问题
*/
@Setter
@Getter
public
class
AccessToken
{
/**
* accessToken 访问参数
*/
@Setter
@Getter
public
static
class
Request
{
/**
* 应用id需要在BEAN系统添加应用后生成
*/
private
String
appKey
;
/**
* 当前时间时间戳
*/
private
Long
timestamp
;
/**
* MD5(${secretKey}_${timestamp})
* 应用的secretKey和时间戳字段通过下划线拼接后MD5加密(不区分大小写
*/
private
String
verifyCode
;
}
@Setter
@Getter
public
static
class
Result
{
/**
* accessToken
*/
private
String
access_token
;
/**
* accessToken到期时间
*/
private
String
expire_time
;
}
}
\ No newline at end of file
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BeanAccountInfo.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
/**
* BEAN 账号信息
*/
@Setter
@Getter
public
class
BeanAccountInfo
{
/**
* BEAN账号ID
*/
private
String
id
;
/**
* 账号中心ID
*/
private
String
centerId
;
/**
* hr系统员工编号
*/
private
String
hrId
;
/**
* 姓名
*/
private
String
userName
;
/**
* 联系电话
*/
private
String
cellPhone
;
/**
* 所在部门id集合
*/
private
List
<
String
>
departmentIds
;
}
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BeanR.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* bean 返回数据通用结构
*
* @param <E> 实际业务结果对象
*/
@Setter
@Getter
public
class
BeanR
<
E
>
{
/**
* 返回提示信息
*/
private
String
message
;
/**
* 状态码
*/
private
Integer
errorCode
;
/**
* 成功&失败
*/
private
Boolean
succ
;
/**
* 数据对象
*/
private
E
data
;
}
project-order/src/main/java/com/dituhui/pea/order/feign/bean/BranchRes.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
*
*/
@Setter
@Getter
public
class
BranchRes
{
/**
* 账户中心部门id
*/
private
String
bsId
;
/**
* 部门名称
*/
private
String
name
;
/**
* 部门缩写
*/
private
String
abbreviation
;
/**
* 部门负责人联系方式
*/
private
String
phone
;
/**
* 上级部门id
*/
private
String
bsParentId
;
/**
* 部门类型
*/
private
String
type
;
/**
* 1:启用 0:禁用 -1:注销
*/
private
int
enable
;
}
project-order/src/main/java/com/dituhui/pea/order/feign/bean/Department.java
0 → 100644
View file @
c9e832f
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
/**
* 部门列表详细信息
*/
@Setter
@Getter
public
class
Department
{
/**
* Bean系统的部门ID UUID
*/
private
String
id
;
/**
* 账号中心部门id
*/
private
String
bsDeptId
;
/**
* 部门名称
*/
private
String
tagName
;
/**
* 部门描述 非必须
*/
private
String
desc
;
/**
* 部门缩写
*/
private
String
abbreviation
;
/**
* 部门编号
*/
private
String
code
;
/**
* 部门负责人联系方式
*/
private
String
phone
;
/**
* 上级部门ID(存疑, 文档没有本字段描述)
*/
private
String
parentId
;
/**
* 所属大区
*/
private
String
belongedRegion
;
/**
* 所属分部
*/
private
String
belongedBranch
;
/**
* 部分级别 集团、大区、分部
*/
private
String
deptLevel
;
/**
* 类型 分站、外围、寄修中心
*/
private
String
deptType
;
/**
* 是否启用外围仓 0未启用 1启用
*/
private
int
peripheralWarehouseEnabled
;
/**
* 最长配件保留时长(天)
*/
private
int
partReserveTimeMax
;
/**
* 状态 1启用 0禁用
*/
private
int
enable
;
/**
* 子部门列表跟外层结构相同
*/
private
List
<
Department
>
children
;
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment