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
02cbb220
Commit
02cbb220
authored
Aug 17, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导出动态列
parent
5276c24c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
32 deletions
+43
-32
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+6
-19
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
...com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
+27
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
...tendance/service/impl/AttendanceRecordHikServiceImpl.java
+10
-9
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
02cbb220
...
...
@@ -47,6 +47,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -190,7 +191,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
AttendanceRecordQuery
attendanceRecordQuery
=
new
AttendanceRecordQuery
();
attendanceRecordQuery
.
setAttendanceDateStart
(
DateUtil
.
today
());
attendanceRecordQuery
.
setAttendanceDateStart
(
DateUtil
.
beginOfMonth
(
new
Date
()).
toDateStr
());
attendanceRecordQuery
.
setAttendanceDateEnd
(
DateUtil
.
today
());
List
<
AttendanceRecordEntity
>
attendanceRecordEntities
=
recordService
.
find
(
attendanceRecordQuery
);
//总打卡
...
...
@@ -252,24 +253,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
}
private
String
generateMenuUrlCode
(
Set
<
String
>
urls
)
{
try
{
String
securityKey
=
GlobalSysInfo
.
getPropertyValue
(
SysConstains
.
PROP_COOKIE_SECURITY_KEY
);
StringBuilder
sb
=
new
StringBuilder
();
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
for
(
String
url
:
urls
)
{
int
index
=
url
.
hashCode
()
&
(
Integer
.
MAX_VALUE
-
1
);
sb
.
append
(
index
).
append
(
","
);
}
}
String
menuUrl
=
sb
.
toString
();
return
AESUtil
.
encrypt
(
menuUrl
,
securityKey
);
}
catch
(
Throwable
e
)
{
log
.
error
(
"编码异常"
,
e
);
return
null
;
}
}
@RequestMapping
(
"validcode"
)
public
String
validCode
(
HttpServletRequest
request
,
HttpServletResponse
response
,
LoginForm
loginForm
)
{
...
...
@@ -322,4 +305,8 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
DateUtil
.
beginOfMonth
(
new
Date
()).
toDateStr
());
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/DingTalkLoginController.java
View file @
02cbb220
package
com.mortals.xhx.busiz.h5.web
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.IdUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
...
...
@@ -25,9 +26,14 @@ import com.mortals.xhx.base.system.user.model.UserQuery;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.valid.service.ValidCodeService
;
import
com.mortals.xhx.busiz.h5.req.DingTalkReq
;
import
com.mortals.xhx.common.code.GoWorkResultEnum
;
import
com.mortals.xhx.common.code.OffWorkResultEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.common.pdu.HomeStatInfo
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordQuery
;
import
com.mortals.xhx.module.attendance.model.AttendanceVacationRecordQuery
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.dingding.IDingTalkService
;
...
...
@@ -45,10 +51,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.*;
...
...
@@ -190,6 +193,26 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
}
}
@RequestMapping
(
"index"
)
public
String
index
()
throws
Exception
{
JSONObject
ret
=
new
JSONObject
();
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
)
{
return
JSONObject
.
toJSONString
(
Rest
.
fail
(
ERROR_TOKEN_EXPIRED
,
ERROR_TOKEN_EXPIRED_CONTENT
));
}
JSONObject
data
=
new
JSONObject
();
UserEntity
userEntity
=
userService
.
get
(
user
.
getId
());
String
token
=
authTokenService
.
getToken
(
request
);
data
.
put
(
"id"
,
user
.
getId
());
data
.
put
(
"token"
,
token
);
data
.
put
(
"userType"
,
userEntity
.
getUserType
());
ret
.
put
(
KEY_RESULT_DATA
,
data
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"用户登录系统成功!"
);
return
ret
.
toJSONString
();
}
@RequestMapping
(
"logout"
)
public
void
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
recordSysLog
(
request
,
"退出登录"
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
View file @
02cbb220
...
...
@@ -154,11 +154,9 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
commonData
.
setStaffId
(
attendanceRecordEntity
.
getStaffId
());
commonData
.
setDateStr
(
dateStr
);
workAbstract
.
doHandleWork
(
commonData
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
detailEntityList
))
{
attendanceRecordEntity
.
setAttendanceRecordDetailList
(
detailEntityList
);
//判断签到 只要存在一次正常打卡详细记录 就判断签到
...
...
@@ -307,21 +305,22 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
if
(!
ObjectUtils
.
isEmpty
(
detailEntityList
))
{
attendanceRecordEntity
.
setAttendanceRecordDetailList
(
detailEntityList
);
//判断签到 只要存在一次正常打卡详细记录 就判断签到
attendanceRecordEntity
.
setSignInResult
(
YesNoEnum
.
YES
.
getValue
());
for
(
AttendanceRecordDetailEntity
detailEntity
:
detailEntityList
)
{
if
(
GoWorkResultEnum
.
正常
.
getValue
()
==
detailEntity
.
getGoWorkResult
()
||
GoWorkResultEnum
.
迟到
.
getValue
()
==
detailEntity
.
getOffWorkResult
())
{
attendanceRecordEntity
.
setSignInResult
(
YesNoEnum
.
YES
.
getValue
());
if
(
GoWorkResultEnum
.
缺卡
.
getValue
()
==
detailEntity
.
getGoWorkResult
()
||
GoWorkResultEnum
.
迟到
.
getValue
()
==
detailEntity
.
getOffWorkResult
())
{
attendanceRecordEntity
.
setSignInResult
(
YesNoEnum
.
NO
.
getValue
());
break
;
}
}
attendanceRecordEntity
.
setSignOutResult
(
YesNoEnum
.
YES
.
getValue
());
for
(
AttendanceRecordDetailEntity
detailEntity
:
detailEntityList
)
{
if
(
OffWorkResultEnum
.
正常
.
getValue
()
==
detailEntity
.
getOffWorkResult
()
||
OffWorkResultEnum
.
早退
.
getValue
()
==
detailEntity
.
getOffWorkResult
())
{
attendanceRecordEntity
.
setSignOutResult
(
YesNoEnum
.
YES
.
getValue
());
if
(
OffWorkResultEnum
.
缺卡
.
getValue
()
==
detailEntity
.
getOffWorkResult
()
||
OffWorkResultEnum
.
早退
.
getValue
()
==
detailEntity
.
getOffWorkResult
())
{
attendanceRecordEntity
.
setSignOutResult
(
YesNoEnum
.
NO
.
getValue
());
break
;
}
}
for
(
AttendanceRecordDetailEntity
detailEntity
:
detailEntityList
)
{
/*
for (AttendanceRecordDetailEntity detailEntity : detailEntityList) {
if (OffWorkResultEnum.缺卡.getValue() == detailEntity.getOffWorkResult()) {
attendanceRecordEntity.setPunchResult(YesNoEnum.NO.getValue());
break;
...
...
@@ -331,10 +330,12 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
attendanceRecordEntity.setPunchResult(YesNoEnum.NO.getValue());
break;
}
}
}
*/
if
(
YesNoEnum
.
YES
.
getValue
()
==
attendanceRecordEntity
.
getSignInResult
()
&&
YesNoEnum
.
YES
.
getValue
()
==
attendanceRecordEntity
.
getSignOutResult
())
{
attendanceRecordEntity
.
setPunchResult
(
YesNoEnum
.
YES
.
getValue
());
}
else
{
attendanceRecordEntity
.
setPunchResult
(
YesNoEnum
.
NO
.
getValue
());
}
attendanceRecordEntity
.
setAttendType
(
"现场打卡"
);
...
...
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