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
3fe9aaa7
Commit
3fe9aaa7
authored
Dec 22, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6
parents
69885154
508cc72d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
5 deletions
+43
-5
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+43
-5
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
View file @
3fe9aaa7
...
...
@@ -73,13 +73,24 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
@Transactional
public
void
saveOrganization
(
List
<
OrganizationExportDto
>
data
,
List
<
OrganizationUserExportDto
>
userData
,
String
bizOrgCode
)
{
int
sort
=
organizationMapper
.
selectMaxSort
();
checkOrganizationData
(
data
);
checkOrganizationUserData
(
userData
);
for
(
OrganizationExportDto
dto
:
data
)
{
LambdaQueryWrapper
<
Organization
>
lambda
=
new
QueryWrapper
<
Organization
>().
lambda
();
lambda
.
eq
(
Organization:
:
getIsDelete
,
false
);
lambda
.
eq
(
Organization:
:
getEmergencyTeamName
,
dto
.
getEmergencyTeamName
());
List
<
Organization
>
organizations
=
organizationMapper
.
selectList
(
lambda
);
Organization
organization
=
new
Organization
();
BeanUtils
.
copyProperties
(
dto
,
organization
);
sort
=
sort
+
1
;
organization
.
setSort
(
sort
);
organization
.
setBizOrgCode
(
bizOrgCode
);
organizationMapper
.
insert
(
organization
);
if
(
CollectionUtils
.
isEmpty
(
organizations
)){
BeanUtils
.
copyProperties
(
dto
,
organization
);
sort
=
sort
+
1
;
organization
.
setSort
(
sort
);
organization
.
setBizOrgCode
(
bizOrgCode
);
organizationMapper
.
insert
(
organization
);
}
else
{
Organization
organization1
=
organizations
.
get
(
0
);
BeanUtils
.
copyProperties
(
organization1
,
organization
);
}
List
<
OrganizationUserExportDto
>
collect
=
userData
.
stream
().
filter
(
item
->
item
.
getEmergencyTeamName
().
equals
(
dto
.
getEmergencyTeamName
())).
collect
(
Collectors
.
toList
());
for
(
OrganizationUserExportDto
userExportDto
:
collect
)
{
OrganizationUser
organizationUser
=
new
OrganizationUser
();
...
...
@@ -90,6 +101,33 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
}
}
private
void
checkOrganizationData
(
List
<
OrganizationExportDto
>
data
)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
OrganizationExportDto
dto
=
data
.
get
(
i
);
if
(
ObjectUtils
.
isEmpty
(
dto
.
getEmergencyTeamName
()))
{
throw
new
BadRequest
(
"应急救援小组信息表第"
+(
i
+
1
)
+
"行, 应急救援小组名称为必填信息!"
);
}
if
(
ObjectUtils
.
isEmpty
(
dto
.
getGroupLeader
()))
{
throw
new
BadRequest
(
"应急救援小组信息表第"
+
(
i
+
1
)
+
"行, 组长为必填信息!"
);
}
}
}
private
void
checkOrganizationUserData
(
List
<
OrganizationUserExportDto
>
data
)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
OrganizationUserExportDto
dto
=
data
.
get
(
i
);
if
(
ObjectUtils
.
isEmpty
(
dto
.
getEmergencyTeamName
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)
+
"行, 应急救援小组名称为必填信息!"
);
}
if
(
ObjectUtils
.
isEmpty
(
dto
.
getMemberName
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)
+
"行, 组员姓名为必填信息!"
);
}
if
(
ObjectUtils
.
isEmpty
(
dto
.
getTelephone
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)+
"行, 组员电话为必填信息!"
);
}
}
}
@Override
public
Organization
saveOrganization
(
Organization
organization
)
{
...
...
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