Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
e376254a
Commit
e376254a
authored
Dec 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
30ce3869
9c9e5646
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordController.java
...xhx/module/attendance/web/AttendanceRecordController.java
+25
-7
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordController.java
View file @
e376254a
...
@@ -9,6 +9,7 @@ import com.mortals.framework.exception.AppException;
...
@@ -9,6 +9,7 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.framework.utils.ServletUtils
;
...
@@ -29,6 +30,7 @@ import com.mortals.xhx.module.dept.service.DeptService;
...
@@ -29,6 +30,7 @@ import com.mortals.xhx.module.dept.service.DeptService;
import
com.mortals.xhx.module.perform.model.PerformAttendAppealEntity
;
import
com.mortals.xhx.module.perform.model.PerformAttendAppealEntity
;
import
com.mortals.xhx.module.perform.model.vo.AppealInfo
;
import
com.mortals.xhx.module.perform.model.vo.AppealInfo
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.checkerframework.checker.units.qual.A
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -44,6 +46,7 @@ import com.mortals.xhx.module.attendance.service.AttendanceRecordService;
...
@@ -44,6 +46,7 @@ import com.mortals.xhx.module.attendance.service.AttendanceRecordService;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.util.*
;
import
java.util.*
;
...
@@ -103,11 +106,7 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
...
@@ -103,11 +106,7 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
@Override
@Override
public
void
doExportBefore
(
Context
context
,
AttendanceRecordEntity
query
,
List
<
String
>
properties
)
throws
AppException
{
public
void
doExportBefore
(
Context
context
,
AttendanceRecordEntity
query
,
List
<
String
>
properties
)
throws
AppException
{
String
bool
=
cacheService
.
get
(
RedisCacheKeys
.
getRecordExportLockKey
());
if
(!
ObjectUtils
.
isEmpty
(
bool
))
{
throw
new
AppException
(
"每日数据正在导出中,请稍后再试!"
);
}
cacheService
.
set
(
RedisCacheKeys
.
getRecordExportLockKey
(),
"111"
,
120L
);
if
(
query
.
getGroupId
()
!=
null
)
{
if
(
query
.
getGroupId
()
!=
null
)
{
query
.
setAttendanceGroupId
(
query
.
getGroupId
());
query
.
setAttendanceGroupId
(
query
.
getGroupId
());
}
}
...
@@ -116,7 +115,13 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
...
@@ -116,7 +115,13 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
query
.
setAttendanceDateStart
(
DateUtil
.
today
());
query
.
setAttendanceDateStart
(
DateUtil
.
today
());
query
.
setAttendanceDateEnd
(
DateUtil
.
today
());
query
.
setAttendanceDateEnd
(
DateUtil
.
today
());
}
}
try
{
if
(
DateUtils
.
getBetween
(
query
.
getAttendanceDateStart
(),
query
.
getAttendanceDateEnd
(),
DateUtils
.
P_yyyy_MM_dd
,
2
)
!=
0
)
{
throw
new
AppException
(
"选择的日期跨度不能超过一天"
);
}
}
catch
(
Exception
e
){
throw
new
AppException
(
e
.
getMessage
());
}
if
(
ObjectUtils
.
isEmpty
(
query
.
getOrderColList
()))
{
if
(
ObjectUtils
.
isEmpty
(
query
.
getOrderColList
()))
{
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"attendanceDate"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"staffName"
,
OrderCol
.
DESCENDING
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"attendanceDate"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"staffName"
,
OrderCol
.
DESCENDING
)));
}
else
{
}
else
{
...
@@ -139,6 +144,11 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
...
@@ -139,6 +144,11 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
properties
.
addAll
(
query
.
getProperties
());
properties
.
addAll
(
query
.
getProperties
());
}
}
String
bool
=
cacheService
.
get
(
RedisCacheKeys
.
getRecordExportLockKey
());
if
(!
ObjectUtils
.
isEmpty
(
bool
))
{
throw
new
AppException
(
"每日数据正在导出中,请稍后再试!"
);
}
cacheService
.
set
(
RedisCacheKeys
.
getRecordExportLockKey
(),
"111"
,
120L
);
}
}
@Override
@Override
...
@@ -250,6 +260,15 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
...
@@ -250,6 +260,15 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
this
.
responseStream
(
response
,
data
,
fileName
);
this
.
responseStream
(
response
,
data
,
fileName
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
-
1
);
ret
.
put
(
"msg"
,
e
.
getMessage
());
try
{
IOUtils
.
write
(
ret
.
toJSONString
(),
response
.
getOutputStream
());
}
catch
(
IOException
e1
){
}
this
.
doException
(
request
,
"导出异常"
,
new
HashMap
<>(),
e
);
this
.
doException
(
request
,
"导出异常"
,
new
HashMap
<>(),
e
);
}
}
}
}
...
@@ -458,5 +477,4 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
...
@@ -458,5 +477,4 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
}
}
return
jsonObject
.
toJSONString
();
return
jsonObject
.
toJSONString
();
}
}
}
}
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