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
ae41d5f5
Commit
ae41d5f5
authored
Jul 15, 2021
by
付培阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
值班导入导出优化:未排班补全休班
parent
92b1df43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
27 deletions
+17
-27
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+17
-27
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/controller/ExcelController.java
View file @
ae41d5f5
...
...
@@ -89,7 +89,7 @@ public class ExcelController extends BaseController {
@Autowired
IDutyPersonService
iDutyPersonService
;
private
static
final
String
NOT_DUTY
=
"休"
;
private
static
final
String
NOT_DUTY
=
"休
班
"
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -677,20 +677,8 @@ public class ExcelController extends BaseController {
list
.
add
(
o
.
getPostTypeName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyShift
.
forEach
(
item
->
dutyShiftMap
.
put
(
format
.
format
(
item
.
getDutyDate
()),
item
.
getShiftName
()));
if
(!
dutyShift
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
if
(
dutyShiftMap
.
containsKey
(
dayByMonth
.
get
(
i
)))
{
list
.
add
(
dutyShiftMap
.
get
(
dayByMonth
.
get
(
i
)));
}
else
{
list
.
add
(
NOT_DUTY
);
}
}
}
data
.
add
(
list
);
});
}
...
...
@@ -713,26 +701,28 @@ public class ExcelController extends BaseController {
list
.
add
(
o
.
getCarName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyShift
.
forEach
(
item
->
dutyShiftMap
.
put
(
format
.
format
(
item
.
getDutyDate
()),
item
.
getShiftName
()));
if
(!
dutyShift
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
if
(
dutyShiftMap
.
containsKey
(
dayByMonth
.
get
(
i
)))
{
list
.
add
(
dutyShiftMap
.
get
(
dayByMonth
.
get
(
i
)));
}
else
{
list
.
add
(
NOT_DUTY
);
}
}
}
data
.
add
(
list
);
});
}
return
data
;
}
private
void
initDutyShift
(
List
<
String
>
dayByMonth
,
List
<
DutyPersonShiftDto
>
dutyShift
,
ArrayList
<
Object
>
list
)
{
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyShift
.
forEach
(
item
->
dutyShiftMap
.
put
(
format
.
format
(
item
.
getDutyDate
()),
item
.
getShiftName
()));
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
if
(
dutyShiftMap
.
containsKey
(
dayByMonth
.
get
(
i
)))
{
list
.
add
(
dutyShiftMap
.
get
(
dayByMonth
.
get
(
i
)));
}
else
{
list
.
add
(
NOT_DUTY
);
}
}
}
private
void
exportDutyTemplate
(
HttpServletResponse
response
,
String
classUrl
,
List
<
String
>
dayByMonth
,
ExcelDto
excelDto
,
List
<?
extends
Object
>
data
,
Boolean
flag
)
{
try
{
...
...
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