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
9019dd78
Commit
9019dd78
authored
Oct 18, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交120急救站的导入接口开发
parent
3c1532be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
0 deletions
+93
-0
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+33
-0
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+60
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
9019dd78
...
...
@@ -308,4 +308,37 @@ AND NAME IS NOT NULL
GROUP BY
NAME
</select>
<select
id=
'getFireTeamBySequenceNbr'
resultType=
"map"
>
SELECT
name
FROM
cb_fire_team
WHERE
sequence_nbr = #{sequenceNbr} and is_delete=0
</select>
<select
id=
'getFirstAidForTypeCodeAndCompanyId'
resultType=
"map"
>
>
SELECT
name,
sequence_nbr
FROM
cb_fire_team
WHERE
company = #{company}
AND is_delete = 0
AND type_code = (
SELECT
CODE
FROM
cb_data_dictionary
WHERE
`name` = '企(事)业单位医疗救援队(站)'
AND type = 'XFJGLX'
)
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
9019dd78
...
...
@@ -332,6 +332,9 @@ public class ExcelServiceImpl {
case
"XFAQBG"
:
excelImportSafeReport
(
multipartFile
);
break
;
case
"JJZB"
:
excelImportDutyPerson
(
multipartFile
,
"JJZB"
);
break
;
}
return
;
}
...
...
@@ -952,8 +955,65 @@ public class ExcelServiceImpl {
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
dutyType
))
{
initDutyFireFightingData
(
sheet
,
dataList
,
dayByMonth
);
dutyFireFightingService
.
saveImportData
(
dataList
);
}
else
if
(
ExcelEnums
.
JJZB
.
getType
().
equals
(
dutyType
))
{
initDutyFirstAidData
(
sheet
,
dataList
,
dayByMonth
);
dutyFireFightingService
.
saveImportData
(
dataList
);
}
}
}
private
void
initDutyFirstAidData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyFirstAidDto
dutyFirstAidDto
=
new
DutyFirstAidDto
();
// row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
2
);
if
(
cell
==
null
)
{
continue
;
}
cell
=
row
.
getCell
(
1
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyFirstAidDto
.
setTeamId
(
split
[
1
]);
dutyFirstAidDto
.
setTeamName
(
split
[
0
]);
}
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFirstAidDto
.
setUserName
(
splitStr
[
0
]);
dutyFirstAidDto
.
setUserId
(
splitStr
[
1
]);
}
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFirstAidDto
.
setPostTypeName
(
splitStr
[
0
]);
dutyFirstAidDto
.
setPostType
(
splitStr
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
splitStr
=
cell
.
toString
().
split
(
"@"
);
dutyFirstAidDto
.
setFirstAid
(
splitStr
[
0
]);
dutyFirstAidDto
.
setFirstAidId
(
splitStr
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
dutyFirstAidDto
.
setDutyShift
(
dutyShift
);
Map
<
String
,
Object
>
dutyPersonDtoMap
=
Bean
.
BeantoMap
(
dutyFirstAidDto
);
dataList
.
add
(
dutyPersonDtoMap
);
}
}
private
void
excelImportSafeReport
(
MultipartFile
multipartFile
)
throws
Exception
{
...
...
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