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 3be86770
authored
Oct 25, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:组织机构网点导入代码
1 parent
8d4244f9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
13 deletions
project-order/src/main/java/com/dituhui/pea/order/entity/OrgClusterEntity.java
project-order/src/main/java/com/dituhui/pea/order/entity/OrgGroupEntity.java
project-order/src/main/java/com/dituhui/pea/order/feign/bean/ServiceOrg.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/entity/OrgClusterEntity.java
View file @
3be8677
...
...
@@ -31,7 +31,7 @@ public class OrgClusterEntity {
private
String
cityName
;
private
Integer
status
;
private
Integer
status
=
1
;
private
String
updateUser
;
...
...
project-order/src/main/java/com/dituhui/pea/order/entity/OrgGroupEntity.java
View file @
3be8677
...
...
@@ -88,5 +88,37 @@ public class OrgGroupEntity {
*/
private
LocalDateTime
updateTime
=
LocalDateTime
.
now
();
public
OrgGroupEntity
()
{}
public
OrgGroupEntity
()
{
}
/**
* 管理城市列表
*/
private
String
citycodeList
;
/**
* 部门缩写
*/
private
String
abbreviation
;
/**
* 部门编号
*/
private
String
code
;
/**
* 部门负责人联系方式
*/
private
String
phone
;
/**
* 是否启用外围仓 0未启用 1启用
*/
private
Integer
warehouseEnabled
=
0
;
/**
* 最长配件保留时长(天)
*/
private
Integer
reserveTimeMax
=
0
;
/**
* 帐号状态(0无效 1有效)
*/
private
Integer
status
=
1
;
}
project-order/src/main/java/com/dituhui/pea/order/feign/bean/ServiceOrg.java
View file @
3be8677
...
...
@@ -22,7 +22,7 @@ public class ServiceOrg {
/**
* 状态;1正常、0注销
*/
private
int
status
;
private
Integer
status
;
/**
* 服务商类型
*/
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
View file @
3be8677
...
...
@@ -135,6 +135,11 @@ public class BeanRemoteServiceImpl {
}
/**
* 处理全部机构
*
* @return
*/
public
Result
allDepartment
()
{
//获取token
final
String
accessToken
=
getAccessToken
();
...
...
@@ -143,13 +148,20 @@ public class BeanRemoteServiceImpl {
return
Result
.
failed
(
beanR
.
getMessage
());
}
for
(
Department
department
:
beanR
.
getData
())
{
log
.
info
(
"处理部门详情---->{}"
+
department
.
getBsDeptId
());
log
.
info
(
"处理部门详情---->{}"
,
department
.
getBsDeptId
());
Result
result
=
this
.
departmentDetail
(
accessToken
,
department
.
getBsDeptId
());
log
.
info
(
"处理部门详情,id:{},结果---->{}"
+
department
.
getBsDeptId
(),
result
.
getCode
());
log
.
info
(
"处理部门详情,id:{},结果---->{}"
,
department
.
getBsDeptId
(),
result
.
getCode
());
}
return
Result
.
success
();
}
/**
* 处理单极机构,包含大区,分部,分站
*
* @param token
* @param orgId
* @return
*/
public
Result
departmentDetail
(
String
token
,
String
orgId
)
{
//获取token
BeanR
<
Department
>
departmentBeanR
=
beanRemoteService
.
departmentDetail
(
token
,
orgId
);
...
...
@@ -201,14 +213,33 @@ public class BeanRemoteServiceImpl {
groupEntity
=
new
OrgGroupEntity
();
}
groupEntity
.
setGroupName
(
data
.
getTagName
());
//groupEntity.setAbbreviation(data.getAbbreviation());
//groupEntity.setStatus(data.getEnable());
//groupEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "" : JSONObject.toJSONString(data.getManageCityList()));
//groupEntity.setMemo(data.getDesc());
//groupEntity.setCode(data.getCode());
//groupEntity.setPhone(data.getPhone());
//groupEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
//groupEntity.setReserveTimeMax(data.getPartReserveTimeMax());
groupEntity
.
setAbbreviation
(
data
.
getAbbreviation
());
groupEntity
.
setStatus
(
data
.
getEnable
());
groupEntity
.
setCitycodeList
(
CollectionUtils
.
isEmpty
(
data
.
getManageCityList
())
?
""
:
JSONObject
.
toJSONString
(
data
.
getManageCityList
()));
groupEntity
.
setMemo
(
data
.
getDesc
());
groupEntity
.
setCode
(
data
.
getCode
());
groupEntity
.
setPhone
(
data
.
getPhone
());
groupEntity
.
setWarehouseEnabled
(
data
.
getPeripheralWarehouseEnabled
());
groupEntity
.
setReserveTimeMax
(
data
.
getPartReserveTimeMax
());
//处理clusterId和branchId
OrgBranchEntity
branchEntity
=
branchMap
.
get
(
data
.
getParentId
());
if
(
ObjUtil
.
isNull
(
branchEntity
))
{
branchEntity
=
orgBranchDao
.
getByBranchId
(
data
.
getParentId
());
if
(
ObjUtil
.
isNull
(
branchEntity
))
{
return
Result
.
failed
();
}
branchMap
.
put
(
data
.
getParentId
(),
branchEntity
);
}
groupEntity
.
setBranchId
(
data
.
getParentId
());
groupEntity
.
setClusterId
(
branchEntity
.
getClusterId
());
//处理分站外围
if
(
data
.
getDeptType
().
equals
(
BeanOrgLevelEnum
.
PERIPHERY
.
getCode
()))
{
groupEntity
.
setKind
(
2
);
}
if
(
data
.
getDeptType
().
equals
(
BeanOrgLevelEnum
.
STATION
.
getCode
()))
{
groupEntity
.
setKind
(
1
);
}
groupEntity
.
setCategory
(
1
);
orgGroupDao
.
save
(
groupEntity
);
return
Result
.
success
();
}
...
...
@@ -217,6 +248,53 @@ public class BeanRemoteServiceImpl {
/**
* 处理全部网点
*
* @return
*/
public
Result
serviceOrgList
()
{
//获取token
final
String
accessToken
=
getAccessToken
();
BeanR
<
List
<
ServiceOrg
>>
listBeanR
=
beanRemoteService
.
serviceOrgList
(
accessToken
,
1
);
log
.
info
(
"[查询网点/车队列表]【/api/openapi/department/queryServiceOrgList】返回值-------------------->{}"
,
JsonUtil
.
toJson
(
listBeanR
));
if
(!
listBeanR
.
getSuccess
()
||
ObjUtil
.
isNull
(
listBeanR
.
getData
()))
{
return
Result
.
failed
(
listBeanR
.
getMessage
());
}
for
(
ServiceOrg
serviceOrg
:
listBeanR
.
getData
())
{
log
.
info
(
"处理网点部门详情---->{}"
,
serviceOrg
.
getServiceOrgId
());
Result
result
=
this
.
serviceOrgDetail
(
accessToken
,
serviceOrg
);
log
.
info
(
"处理网点部门详情,id:{},结果---->{}"
,
serviceOrg
.
getServiceOrgId
(),
result
.
getCode
());
}
return
Result
.
success
();
}
private
Result
serviceOrgDetail
(
String
accessToken
,
ServiceOrg
serviceOrg
)
{
BeanR
<
ServiceOrgDetail
>
beanR
=
beanRemoteService
.
serviceOrgDetail
(
accessToken
,
serviceOrg
.
getServiceOrgId
());
log
.
info
(
"[查询网点/车队列表]【/api/openapi/department/queryServiceOrgList】返回值-------------------->{}"
,
JsonUtil
.
toJson
(
beanR
));
if
(!
beanR
.
getSuccess
()
||
ObjUtil
.
isNull
(
beanR
.
getData
()))
{
return
Result
.
failed
(
beanR
.
getMessage
());
}
ServiceOrgDetail
data
=
beanR
.
getData
();
OrgGroupEntity
groupEntity
=
orgGroupDao
.
getByGroupId
(
data
.
getServiceOrgId
());
if
(
ObjUtil
.
isNull
(
groupEntity
))
{
groupEntity
=
new
OrgGroupEntity
();
}
groupEntity
.
setGroupName
(
data
.
getName
());
groupEntity
.
setStatus
(
data
.
getStatus
());
groupEntity
.
setCitycodeList
(
CollectionUtils
.
isEmpty
(
data
.
getServiceRange
())
?
""
:
JSONObject
.
toJSONString
(
data
.
getServiceRange
()));
groupEntity
.
setPhone
(
data
.
getContactPhone
());
groupEntity
.
setBranchId
(
data
.
getBelongBranch
().
getBsDeptId
());
groupEntity
.
setClusterId
(
data
.
getBelongRegion
().
getBsDeptId
());
//处理分站外围
groupEntity
.
setKind
(
4
);
groupEntity
.
setCategory
(
2
);
groupEntity
.
setAddress
(
data
.
getBusinessAddress
().
getAddress
());
orgGroupDao
.
save
(
groupEntity
);
return
Result
.
success
();
}
/**
* 获取bean token
*
* @return
...
...
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