Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
63b0448e
Commit
63b0448e
authored
May 06, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组织机构及人员调用平台顺序调整,现在调用顺序为业务-平台-业务
parent
9390dd8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
143 deletions
+143
-143
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+118
-118
StationBasicServiceImpl.java
...odule/jxiop/biz/service/impl/StationBasicServiceImpl.java
+25
-25
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
63b0448e
...
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
...
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
* @date 2023-04-20
* @date 2023-04-20
*/
*/
@Service
@Service
public
class
PersonBasicServiceImpl
extends
BaseService
<
PersonBasicDto
,
PersonBasic
,
PersonBasicMapper
>
implements
IPersonBasicService
{
public
class
PersonBasicServiceImpl
extends
BaseService
<
PersonBasicDto
,
PersonBasic
,
PersonBasicMapper
>
implements
IPersonBasicService
{
@Autowired
@Autowired
PersonBasicMapper
personBasicMapper
;
PersonBasicMapper
personBasicMapper
;
...
@@ -56,45 +56,62 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -56,45 +56,62 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
/**
/**
* 分页查询
* 分页查询
*/
*/
public
Page
<
PersonBasicDto
>
queryForPersonBasicPage
(
Page
<
PersonBasicDto
>
page
)
{
public
Page
<
PersonBasicDto
>
queryForPersonBasicPage
(
Page
<
PersonBasicDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
PersonBasicDto
>
queryForPersonBasicList
()
{
public
List
<
PersonBasicDto
>
queryForPersonBasicList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
/**
/**
* 新增
* 新增
*
*
/
*/
@Transactional
@Transactional
public
void
addPerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
){
public
void
addPerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
)
{
//获取人员基本信息数据
//获取人员基本信息数据
PersonUser
personUser
=
model
.
getPersonUser
();
PersonUser
personUser
=
model
.
getPersonUser
();
//获取人员资质信息
//获取人员资质信息
PersonCertificate
personCertificate
=
model
.
getPersonCertificate
();
PersonCertificate
personCertificate
=
model
.
getPersonCertificate
();
//获取人员账号信息
//获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
PersonAccount
personAccount
=
model
.
getPersonAccount
();
//人员基础信息
PersonBasic
personBasic
=
new
PersonBasic
();
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
this
.
baseMapper
.
insert
(
personBasic
);
//人员技能学历信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personSkillEducationService
.
save
(
personSkillEducation
);
//人员资质信息
personCertificate
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
personCertificate
);
//人员账号信息
personAccount
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personAccountService
.
save
(
personAccount
);
//新增平台账号
//新增平台账号
//组装数据
//组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
AgencyUserModel
usd
=
new
AgencyUserModel
();
//应用
//应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
usd
.
setAppCodes
(
personAccount
.
getApplication
());
//手机号
//手机号
usd
.
setMobile
(
personUser
.
getPhone
());
usd
.
setMobile
(
personUser
.
getPhone
());
//角色
//角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
//测点数组
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
//测点数组
if
(
personAccount
.
getDepartmentId
()!=
null
)
{
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
}
usd
.
setOrgRoleSeqs
(
map
);
usd
.
setOrgRoleSeqs
(
map
);
//密码
//密码
...
@@ -107,50 +124,34 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -107,50 +124,34 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setLockStatus
(
"UNLOCK"
);
usd
.
setLockStatus
(
"UNLOCK"
);
//新增平台用户
//新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
setcreateUser
(
usd
);
AgencyUserModel
agencyUserModel
=
this
.
setcreateUser
(
usd
);
//查询部门
//查询部门
DepartmentModel
departmentModel
=
null
;
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()!=
null
)
{
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
}
CompanyModel
companyModel
=
new
CompanyModel
();
CompanyModel
companyModel
=
new
CompanyModel
();
//单位
//单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
//人员基础信息
if
(
departmentModel
!=
null
)
{
PersonBasic
personBasic
=
new
PersonBasic
();
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
if
(
departmentModel
!=
null
){
personBasic
.
setProjectOrgCode
(
departmentModel
.
getOrgCode
());
personBasic
.
setProjectOrgCode
(
departmentModel
.
getOrgCode
());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
else
{
}
else
{
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
}
}
if
(!
personUser
.
getNativePlace
().
isEmpty
())
{
if
(!
personUser
.
getNativePlace
().
isEmpty
())
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
}
this
.
baseMapper
.
insert
(
personBasic
);
//人员技能学历信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personSkillEducationService
.
save
(
personSkillEducation
);
//人员资质信息
personCertificate
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
personCertificate
);
//人员账号信息
personAccount
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personAccount
.
setPuserId
(
agencyUserModel
.
getUserId
());
personAccount
.
setPuserId
(
agencyUserModel
.
getUserId
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
personAccountService
.
save
(
personAccount
);
this
.
personBasicMapper
.
updateById
(
personBasic
);
this
.
personAccountService
.
updateById
(
personAccount
);
}
}
@Transactional
@Transactional
public
PersonDto
updatePerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
,
Long
sequenceNbr
)
{
public
PersonDto
updatePerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
,
Long
sequenceNbr
)
{
//获取人员基本信息数据
//获取人员基本信息数据
...
@@ -159,22 +160,37 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -159,22 +160,37 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
PersonCertificate
personCertificate
=
model
.
getPersonCertificate
();
PersonCertificate
personCertificate
=
model
.
getPersonCertificate
();
//获取人员账号信息
//获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
PersonAccount
personAccount
=
model
.
getPersonAccount
();
//人员基础信息
PersonBasic
personBasic
=
new
PersonBasic
();
personBasic
.
setSequenceNbr
(
sequenceNbr
);
this
.
personBasicMapper
.
updateById
(
personBasic
);
//人员归属信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
PersonSkillEducation
personSkillEducationd
=
personSkillEducationService
.
getOne
(
new
QueryWrapper
<
PersonSkillEducation
>().
eq
(
"person_id"
,
personBasic
.
getSequenceNbr
()));
personSkillEducation
.
setSequenceNbr
(
personSkillEducationd
.
getSequenceNbr
());
personSkillEducationService
.
updateById
(
personSkillEducation
);
//人员资质信息
personCertificateService
.
updateById
(
personCertificate
);
//人员账号信息
personAccount
.
setPersonId
(
sequenceNbr
);
personAccountService
.
updateById
(
personAccount
);
//新增平台账号
//新增平台账号
//组装数据
//组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
AgencyUserModel
usd
=
new
AgencyUserModel
();
//应用
//应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
usd
.
setAppCodes
(
personAccount
.
getApplication
());
//手机号
//手机号
usd
.
setMobile
(
personUser
.
getPhone
());
usd
.
setMobile
(
personUser
.
getPhone
());
//角色
//角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
//测点数组
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
//测点数组
if
(
personAccount
.
getDepartmentId
()!=
null
)
{
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
}
usd
.
setOrgRoleSeqs
(
map
);
usd
.
setOrgRoleSeqs
(
map
);
//密码
//密码
...
@@ -188,41 +204,28 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -188,41 +204,28 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
usd
.
setLockStatus
(
"UNLOCK"
);
usd
.
setLockStatus
(
"UNLOCK"
);
usd
.
setUserId
(
personAccount
.
getPuserId
());
usd
.
setUserId
(
personAccount
.
getPuserId
());
//新增平台用户
//新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
updateuser
(
personAccount
.
getPuserId
(),
usd
);
AgencyUserModel
agencyUserModel
=
this
.
updateuser
(
personAccount
.
getPuserId
(),
usd
);
//查询部门
//查询部门
DepartmentModel
departmentModel
=
null
;
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()!=
null
)
{
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
}
CompanyModel
companyModel
=
new
CompanyModel
();
CompanyModel
companyModel
=
new
CompanyModel
();
//单位
//单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
//人员基础信息
PersonBasic
personBasic
=
new
PersonBasic
();
personBasic
.
setSequenceNbr
(
sequenceNbr
);
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
if
(
departmentModel
!=
null
)
{
if
(
departmentModel
!=
null
)
{
personBasic
.
setProjectOrgCode
(
departmentModel
.
getOrgCode
());
personBasic
.
setProjectOrgCode
(
departmentModel
.
getOrgCode
());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
else
{
}
else
{
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
}
}
if
(
personUser
.
getNativePlace
()!=
null
)
{
if
(
personUser
.
getNativePlace
()
!=
null
)
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
}
this
.
personBasicMapper
.
updateById
(
personBasic
);
//人员归属信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
PersonSkillEducation
personSkillEducationd
=
personSkillEducationService
.
getOne
(
new
QueryWrapper
<
PersonSkillEducation
>().
eq
(
"person_id"
,
personBasic
.
getSequenceNbr
()));
personSkillEducation
.
setSequenceNbr
(
personSkillEducationd
.
getSequenceNbr
());
personSkillEducationService
.
updateById
(
personSkillEducation
);
//人员资质信息
personCertificateService
.
updateById
(
personCertificate
);
//人员账号信息
personAccount
.
setPersonId
(
sequenceNbr
);
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
this
.
personBasicMapper
.
updateById
(
personBasic
);
personAccountService
.
updateById
(
personAccount
);
personAccountService
.
updateById
(
personAccount
);
return
model
;
return
model
;
}
}
...
@@ -236,12 +239,12 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -236,12 +239,12 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
wrapper1
.
eq
(
"is_delete"
,
0
);
wrapper1
.
eq
(
"is_delete"
,
0
);
//人员基础信息
//人员基础信息
PersonBasic
personBasic
=
this
.
getOne
(
wrapper1
);
PersonBasic
personBasic
=
this
.
getOne
(
wrapper1
);
BeanUtils
.
copyProperties
(
personBasic
,
personUser
);
BeanUtils
.
copyProperties
(
personBasic
,
personUser
);
//人员技能学历信息
//人员技能学历信息
QueryWrapper
<
PersonSkillEducation
>
wrapper2
=
new
QueryWrapper
();
QueryWrapper
<
PersonSkillEducation
>
wrapper2
=
new
QueryWrapper
();
wrapper2
.
eq
(
"person_id"
,
sequenceNbr
);
wrapper2
.
eq
(
"person_id"
,
sequenceNbr
);
PersonSkillEducation
personSkillEducation
=
personSkillEducationService
.
getOne
(
wrapper2
);
PersonSkillEducation
personSkillEducation
=
personSkillEducationService
.
getOne
(
wrapper2
);
BeanUtils
.
copyProperties
(
personSkillEducation
,
personUser
);
BeanUtils
.
copyProperties
(
personSkillEducation
,
personUser
);
QueryWrapper
<
PersonCertificate
>
wrapper3
=
new
QueryWrapper
();
QueryWrapper
<
PersonCertificate
>
wrapper3
=
new
QueryWrapper
();
...
@@ -253,10 +256,10 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -253,10 +256,10 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
QueryWrapper
<
PersonAccount
>
wrapper4
=
new
QueryWrapper
();
QueryWrapper
<
PersonAccount
>
wrapper4
=
new
QueryWrapper
();
wrapper4
.
eq
(
"person_id"
,
sequenceNbr
);
wrapper4
.
eq
(
"person_id"
,
sequenceNbr
);
//人员账号信息
//人员账号信息
PersonAccount
personAccount
=
personAccountService
.
getOne
(
wrapper4
);
PersonAccount
personAccount
=
personAccountService
.
getOne
(
wrapper4
);
if
(
personBasic
.
getNativePlace
()!=
null
)
{
if
(
personBasic
.
getNativePlace
()
!=
null
)
{
personUser
.
setNativePlace
(
JSON
.
parseArray
(
personBasic
.
getNativePlace
(),
Integer
.
class
));
personUser
.
setNativePlace
(
JSON
.
parseArray
(
personBasic
.
getNativePlace
(),
Integer
.
class
));
}
}
personDto
.
setPersonUser
(
personUser
);
personDto
.
setPersonUser
(
personUser
);
personDto
.
setPersonCertificate
(
personCertificate
);
personDto
.
setPersonCertificate
(
personCertificate
);
...
@@ -265,31 +268,32 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -265,31 +268,32 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
}
}
@Transactional
@Transactional
public
int
deletePerson
(
String
[]
ids
)
{
public
int
deletePerson
(
String
[]
ids
)
{
//查询所有平台用户
//查询所有平台用户
QueryWrapper
<
PersonAccount
>
wrapper
=
new
QueryWrapper
();
QueryWrapper
<
PersonAccount
>
wrapper
=
new
QueryWrapper
();
wrapper
.
in
(
"person_id"
,
ids
);
wrapper
.
in
(
"person_id"
,
ids
);
List
<
PersonAccount
>
list
=
personAccountService
.
list
(
wrapper
);
List
<
PersonAccount
>
list
=
personAccountService
.
list
(
wrapper
);
List
<
String
>
userid
=
new
ArrayList
<>();
List
<
String
>
userid
=
new
ArrayList
<>();
for
(
PersonAccount
personAccount
:
list
)
{
for
(
PersonAccount
personAccount
:
list
)
{
userid
.
add
(
personAccount
.
getPuserId
());
userid
.
add
(
personAccount
.
getPuserId
());
}
}
//删除平台
//删除平台
this
.
deleuser
(
String
.
join
(
","
,
userid
));
int
deleteResult
=
personBasicMapper
.
deleteList
(
ids
);
return
personBasicMapper
.
deleteList
(
ids
);
this
.
deleuser
(
String
.
join
(
","
,
userid
));
return
deleteResult
;
}
}
//新增平台用户
//新增平台用户
private
AgencyUserModel
setcreateUser
(
AgencyUserModel
userDto
)
{
private
AgencyUserModel
setcreateUser
(
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
create
(
userDto
);
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
create
(
userDto
);
AgencyUserModel
user
=
new
AgencyUserModel
();
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()==
200
)
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
user
=
amosUser
.
getResult
();
}
else
{
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
}
}
...
@@ -298,13 +302,13 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -298,13 +302,13 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
//修改平台用户
//修改平台用户
private
AgencyUserModel
updateuser
(
String
userId
,
AgencyUserModel
userDto
)
{
private
AgencyUserModel
updateuser
(
String
userId
,
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
update
(
userDto
,
userId
);
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
update
(
userDto
,
userId
);
AgencyUserModel
user
=
new
AgencyUserModel
();
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()==
200
)
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
user
=
amosUser
.
getResult
();
}
else
{
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
}
}
...
@@ -312,37 +316,39 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -312,37 +316,39 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
}
}
private
DepartmentModel
getdepartmentModel
(
Long
departmentId
)
{
private
DepartmentModel
getdepartmentModel
(
Long
departmentId
)
{
FeignClientResult
<
DepartmentModel
>
de
=
Privilege
.
departmentClient
.
seleteOne
(
departmentId
);
FeignClientResult
<
DepartmentModel
>
de
=
Privilege
.
departmentClient
.
seleteOne
(
departmentId
);
DepartmentModel
departmentModel
=
new
DepartmentModel
();
DepartmentModel
departmentModel
=
new
DepartmentModel
();
if
(!
ObjectUtils
.
isEmpty
(
de
))
{
if
(!
ObjectUtils
.
isEmpty
(
de
))
{
if
(
de
.
getStatus
()==
200
)
{
if
(
de
.
getStatus
()
==
200
)
{
departmentModel
=
de
.
getResult
();
departmentModel
=
de
.
getResult
();
}
else
{
}
else
{
throw
new
RuntimeException
(
de
.
getMessage
());
throw
new
RuntimeException
(
de
.
getMessage
());
}
}
}
}
return
departmentModel
;
return
departmentModel
;
}
}
public
CompanyModel
getCompanyModel
(
Long
projectId
)
{
public
CompanyModel
getCompanyModel
(
Long
projectId
)
{
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
projectId
);
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
projectId
);
CompanyModel
companyModel
=
new
CompanyModel
();
CompanyModel
companyModel
=
new
CompanyModel
();
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()==
200
)
{
if
(
cResult
.
getStatus
()
==
200
)
{
companyModel
=
cResult
.
getResult
();
companyModel
=
cResult
.
getResult
();
}
else
{
}
else
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
}
}
return
companyModel
;
return
companyModel
;
}
}
private
void
deleuser
(
String
userid
)
{
private
void
deleuser
(
String
userid
)
{
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userid
);
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userid
);
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()!=
200
)
{
if
(
cResult
.
getStatus
()
!=
200
)
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
}
}
...
@@ -352,25 +358,20 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -352,25 +358,20 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
* 分页查询
* 分页查询
*/
*/
public
Page
<
UserMapperDto
>
queryPage
(
Page
<
UserMapperDto
>
page
,
public
Page
<
UserMapperDto
>
queryPage
(
Page
<
UserMapperDto
>
page
,
String
name
,
String
name
,
String
accountName
,
String
accountName
,
String
projectName
,
String
orgCode
)
{
String
projectName
,
String
orgCode
)
{
List
<
UserMapperDto
>
list
=
personBasicMapper
.
queryPage
((
page
.
getCurrent
()-
1
)
*
page
.
getSize
(),
page
.
getSize
(),
name
,
List
<
UserMapperDto
>
list
=
personBasicMapper
.
queryPage
((
page
.
getCurrent
()
-
1
)
*
page
.
getSize
(),
page
.
getSize
(),
name
,
accountName
,
accountName
,
projectName
,
orgCode
);
projectName
,
orgCode
);
List
<
UserMapperDto
>
listcount
=
personBasicMapper
.
queryPagecount
(
name
,
List
<
UserMapperDto
>
listcount
=
personBasicMapper
.
queryPagecount
(
name
,
accountName
,
accountName
,
projectName
,
orgCode
);
projectName
,
orgCode
);
page
.
setTotal
(
listcount
.
size
());
page
.
setTotal
(
listcount
.
size
());
page
.
setRecords
(
list
);
page
.
setRecords
(
list
);
return
page
;
return
page
;
}
}
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationBasicServiceImpl.java
View file @
63b0448e
...
@@ -95,15 +95,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -95,15 +95,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
@Transactional
@Transactional
public
void
add
(
StationBasic
stationBasic
)
{
public
void
add
(
StationBasic
stationBasic
)
{
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
.
setCompanyCode
(
stationBasic
.
getStationCode
());
companyModeldata
=
this
.
addCompanyModel
(
companyModeldata
);
//场站坐标信息
//场站坐标信息
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
...
@@ -115,8 +106,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -115,8 +106,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setAreaCode
(
companyModel
.
getCompanyCode
());
stationBasic
.
setAreaCode
(
companyModel
.
getCompanyCode
());
stationBasic
.
setProjectOrgCode
(
companyModeldata
.
getOrgCode
());
stationBasic
.
setPlatformStationId
(
companyModeldata
.
getSequenceNbr
().
toString
());
//获取类型名称
//获取类型名称
String
typeName
=
this
.
queryByCode
(
CZLX
,
stationBasic
.
getStationType
());
String
typeName
=
this
.
queryByCode
(
CZLX
,
stationBasic
.
getStationType
());
stationBasic
.
setStationTypeName
(
typeName
);
stationBasic
.
setStationTypeName
(
typeName
);
...
@@ -133,6 +122,17 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -133,6 +122,17 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
}
}
}
}
stationCoordinateServiceImpl
.
saveBatch
(
listdate
);
stationCoordinateServiceImpl
.
saveBatch
(
listdate
);
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
.
setCompanyCode
(
stationBasic
.
getStationCode
());
companyModeldata
=
this
.
addCompanyModel
(
companyModeldata
);
stationBasic
.
setProjectOrgCode
(
companyModeldata
.
getOrgCode
());
stationBasic
.
setPlatformStationId
(
companyModeldata
.
getSequenceNbr
().
toString
());
this
.
update
(
stationBasic
);
}
}
...
@@ -200,17 +200,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -200,17 +200,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
public
void
update
(
StationBasic
stationBasic
)
{
public
void
update
(
StationBasic
stationBasic
)
{
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
.
setCompanyCode
(
stationBasic
.
getStationCode
());
companyModeldata
=
this
.
updateCompanyModel
(
companyModeldata
,
Long
.
valueOf
(
stationBasic
.
getPlatformStationId
()));
//场站坐标信息
//场站坐标信息
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
...
@@ -222,8 +211,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -222,8 +211,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setAreaCode
(
companyModel
.
getCompanyCode
());
stationBasic
.
setAreaCode
(
companyModel
.
getCompanyCode
());
stationBasic
.
setProjectOrgCode
(
companyModeldata
.
getOrgCode
());
stationBasic
.
setPlatformStationId
(
companyModeldata
.
getSequenceNbr
().
toString
());
//获取类型名称
//获取类型名称
String
typeName
=
this
.
queryByCode
(
CZLX
,
stationBasic
.
getStationType
());
String
typeName
=
this
.
queryByCode
(
CZLX
,
stationBasic
.
getStationType
());
...
@@ -237,6 +224,18 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -237,6 +224,18 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
listdate
.
add
(
stationCoordinate
);
listdate
.
add
(
stationCoordinate
);
}
}
stationCoordinateServiceImpl
.
saveOrUpdateBatch
(
listdate
);
stationCoordinateServiceImpl
.
saveOrUpdateBatch
(
listdate
);
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
.
setCompanyCode
(
stationBasic
.
getStationCode
());
companyModeldata
=
this
.
updateCompanyModel
(
companyModeldata
,
Long
.
valueOf
(
stationBasic
.
getPlatformStationId
()));
stationBasic
.
setProjectOrgCode
(
companyModeldata
.
getOrgCode
());
stationBasic
.
setPlatformStationId
(
companyModeldata
.
getSequenceNbr
().
toString
());
stationBasicMapper
.
updateById
(
stationBasic
);
}
}
...
@@ -249,8 +248,9 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -249,8 +248,9 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
idscom
.
add
(
personAccount
.
getPlatformStationId
());
idscom
.
add
(
personAccount
.
getPlatformStationId
());
}
}
//删除平台
//删除平台
int
deleteResult
=
stationBasicMapper
.
deleteList
(
ids
);
this
.
deleteCompany
(
String
.
join
(
","
,
idscom
));
this
.
deleteCompany
(
String
.
join
(
","
,
idscom
));
return
stationBasicMapper
.
deleteList
(
ids
)
;
return
deleteResult
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment