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
dfedd171
Commit
dfedd171
authored
Jul 20, 2023
by
王启林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/attendance-performance-platform
parents
51765fdb
f13b28fa
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
284 additions
and
62 deletions
+284
-62
attendance-performance-manager/pom.xml
attendance-performance-manager/pom.xml
+2
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+3
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
...-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
+0
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestController.java
...r/src/main/java/com/mortals/xhx/busiz/TestController.java
+239
-19
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestReq.java
...-manager/src/main/java/com/mortals/xhx/busiz/TestReq.java
+14
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+2
-30
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/AttendanceRecordHikService.java
...module/attendance/service/AttendanceRecordHikService.java
+3
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
...java/com/mortals/xhx/module/dept/service/DeptService.java
+3
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/AbstractDingTalkService.java
.../mortals/xhx/module/dingding/AbstractDingTalkService.java
+6
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
...dingding/personal/service/impl/DingPersonServiceImpl.java
+8
-6
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/AbstractHikService.java
...n/java/com/mortals/xhx/module/hik/AbstractHikService.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/web/JobController.java
...in/java/com/mortals/xhx/module/job/web/JobController.java
+1
-1
attendance-performance-manager/src/main/resources/bootstrap.yml
...ance-performance-manager/src/main/resources/bootstrap.yml
+1
-0
attendance-performance-manager/src/main/resources/config/mybatis-sqlmap-config.xml
...nager/src/main/resources/config/mybatis-sqlmap-config.xml
+1
-1
No files found.
attendance-performance-manager/pom.xml
View file @
dfedd171
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
<profiles.hik.appSecret>
2m9RcPJOKq5j2QPQM4v5
</profiles.hik.appSecret>
<profiles.hik.appSecret>
2m9RcPJOKq5j2QPQM4v5
</profiles.hik.appSecret>
<profiles.dingtalk.domain>
https://oapi.dingtalk.com
</profiles.dingtalk.domain>
<profiles.dingtalk.domain>
https://oapi.dingtalk.com
</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>
api.dingtalk.com
</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>
2652674890
</profiles.dingtalk.agentId>
<profiles.dingtalk.agentId>
2652674890
</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>
dingpqzradgfr4efdi2j
</profiles.dingtalk.appKey>
<profiles.dingtalk.appKey>
dingpqzradgfr4efdi2j
</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
...
@@ -98,6 +99,7 @@
...
@@ -98,6 +99,7 @@
<profiles.hik.appSecret>
2m9RcPJOKq5j2QPQM4v5
</profiles.hik.appSecret>
<profiles.hik.appSecret>
2m9RcPJOKq5j2QPQM4v5
</profiles.hik.appSecret>
<profiles.dingtalk.domain>
http://172.15.28.113:8918
</profiles.dingtalk.domain>
<profiles.dingtalk.domain>
http://172.15.28.113:8918
</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>
172.15.28.113:8919
</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>
2652674890
</profiles.dingtalk.agentId>
<profiles.dingtalk.agentId>
2652674890
</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>
dingpqzradgfr4efdi2j
</profiles.dingtalk.appKey>
<profiles.dingtalk.appKey>
dingpqzradgfr4efdi2j
</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
<profiles.dingtalk.appSecret>
bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
</profiles.dingtalk.appSecret>
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
dfedd171
...
@@ -158,11 +158,12 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
...
@@ -158,11 +158,12 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo
.
setTotalDeptNum
(
totalDeptNum
);
homeStatInfo
.
setTotalDeptNum
(
totalDeptNum
);
//todo
//todo
homeStatInfo
.
setAttendRadio
(
new
BigDecimal
(
9
1
.00
));
homeStatInfo
.
setAttendRadio
(
new
BigDecimal
(
9
8
.00
));
homeStatInfo
.
setLevealPersonNum
(
6
);
homeStatInfo
.
setLevealPersonNum
(
6
);
homeStatInfo
.
setLatePersonNum
(
2
);
homeStatInfo
.
setLatePersonNum
(
2
);
homeStatInfo
.
setLeftEarlyPersonNum
(
1
);
homeStatInfo
.
setLeftEarlyPersonNum
(
1
);
homeStatInfo
.
setMissCardPersonNum
(
0
);
homeStatInfo
.
setMissCardPersonNum
(
23
);
homeStatInfo
.
setAttendPersonNum
(
426
);
data
.
put
(
"homeStat"
,
homeStatInfo
);
data
.
put
(
"homeStat"
,
homeStatInfo
);
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/BaseReq.java
View file @
dfedd171
...
@@ -19,8 +19,6 @@ public abstract class BaseReq implements Serializable {
...
@@ -19,8 +19,6 @@ public abstract class BaseReq implements Serializable {
*/
*/
private
Integer
size
;
private
Integer
size
;
/**
/**
* 工号
* 工号
*/
*/
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestController.java
View file @
dfedd171
...
@@ -3,18 +3,33 @@ package com.mortals.xhx.busiz;
...
@@ -3,18 +3,33 @@ package com.mortals.xhx.busiz;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.PageUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService
;
import
com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.busiz.h5.rsp.ApiResp
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery
;
import
com.mortals.xhx.module.attendance.service.AttendanceRecordHikService
;
import
com.mortals.xhx.module.dept.model.DeptEntity
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq
;
import
com.mortals.xhx.module.hik.door.model.rsp.door.DoorEventDataInfo
;
import
com.mortals.xhx.module.hik.door.service.IHikDoorService
;
import
com.mortals.xhx.module.hik.face.model.req.img.ImgReq
;
import
com.mortals.xhx.module.hik.face.model.req.img.ImgReq
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffService
;
...
@@ -25,17 +40,13 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity;
...
@@ -25,17 +40,13 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -62,26 +73,234 @@ public class TestController {
...
@@ -62,26 +73,234 @@ public class TestController {
private
IHikFaceService
faceService
;
private
IHikFaceService
faceService
;
@Autowired
@Autowired
private
UploadService
uploadService
;
private
UploadService
uploadService
;
@Autowired
private
DeptService
deptService
;
@Autowired
@Autowired
private
PerformPerposeStaffService
performPerposeStaffService
;
private
PerformPerposeStaffService
performPerposeStaffService
;
@Autowired
private
AttendanceRecordHikService
recordHikService
;
@Autowired
private
IHikDoorService
hikDoorService
;
/**
* 同步指定日期的海康数据
*
* @param req
* @return
*/
@PostMapping
(
"hik"
)
public
String
register
(
@RequestBody
TestReq
req
)
{
log
.
info
(
"【测试消息】【请求体】--> "
+
JSONObject
.
toJSONString
(
req
));
DoorEventReq
doorEventReq
=
new
DoorEventReq
();
List
<
Integer
>
eventTypes
=
new
ArrayList
<>();
eventTypes
.
add
(
196885
);
eventTypes
.
add
(
196887
);
eventTypes
.
add
(
196893
);
eventTypes
.
add
(
196888
);
eventTypes
.
add
(
196889
);
eventTypes
.
add
(
196890
);
eventTypes
.
add
(
196891
);
doorEventReq
.
setEventTypes
(
eventTypes
);
doorEventReq
.
setStartTime
(
req
.
getCreateTimeStart
());
doorEventReq
.
setEndTime
(
req
.
getCreateTimeEnd
());
doorEventReq
.
setPageNo
(
1
);
doorEventReq
.
setPageSize
(
1
);
Rest
<
DoorEventDataInfo
>
doorEventsRest
=
hikDoorService
.
getDoorEvents
(
doorEventReq
);
log
.
info
(
"doorEventsRest:{} msg:{}"
,
doorEventsRest
.
getCode
(),
doorEventsRest
.
getMsg
());
if
(
doorEventsRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//分页获取考勤数据
Integer
total
=
doorEventsRest
.
getData
().
getTotal
();
int
pageCount
=
PageUtil
.
totalPage
(
total
,
1000
);
for
(
int
i
=
1
;
i
<=
pageCount
;
i
++)
{
doorEventReq
.
setPageNo
(
i
);
doorEventReq
.
setPageSize
(
1000
);
doorEventsRest
=
hikDoorService
.
getDoorEvents
(
doorEventReq
);
log
.
info
(
"doorEventsRest:{} msg:{},page:{}"
,
doorEventsRest
.
getCode
(),
doorEventsRest
.
getMsg
(),
doorEventReq
.
getPageNo
());
getDoorEvents
(
doorEventsRest
);
}
}
return
"ok"
;
}
private
void
getDoorEvents
(
Rest
<
DoorEventDataInfo
>
doorEventsRest
)
{
//同步当前考勤数据
List
<
AttendanceRecordHikEntity
>
attRecords
=
doorEventsRest
.
getData
().
getList
().
stream
().
map
(
item
->
{
AttendanceRecordHikEntity
recordHikEntity
=
new
AttendanceRecordHikEntity
();
recordHikEntity
.
initAttrValue
();
StaffEntity
staffCache
=
staffService
.
getExtCache
(
StrUtil
.
padPre
(
item
.
getJobNo
(),
8
,
"0"
));
if
(
ObjectUtils
.
isEmpty
(
staffCache
))
{
log
.
info
(
"staff is null !staffCode:{}"
,
item
.
getJobNo
());
return
null
;
}
recordHikEntity
.
setStaffId
(
staffCache
.
getId
());
recordHikEntity
.
setStaffName
(
staffCache
.
getName
());
recordHikEntity
.
setWorkNum
(
staffCache
.
getWorkNum
());
recordHikEntity
.
setDeptId
(
staffCache
.
getDeptId
());
recordHikEntity
.
setDeptName
(
staffCache
.
getDeptName
());
recordHikEntity
.
setPositionId
(
staffCache
.
getPositionId
());
recordHikEntity
.
setPositionName
(
staffCache
.
getPositionName
());
recordHikEntity
.
setAttendanceDate
(
item
.
getEventTime
());
recordHikEntity
.
setAttendanceAddress
(
item
.
getDoorName
());
recordHikEntity
.
setEventSource
(
"门禁点"
);
recordHikEntity
.
setRemark
(
item
.
getEventId
());
recordHikEntity
.
setCreateTime
(
item
.
getEventTime
());
recordHikEntity
.
setCreateUserName
(
"system"
);
recordHikEntity
.
setCreateUserId
(
1L
);
return
recordHikEntity
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
log
.
info
(
"attRecords size:{}"
,
attRecords
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
attRecords
))
{
for
(
AttendanceRecordHikEntity
attRecord
:
attRecords
)
{
//recordHikService.save(attRecord);
try
{
recordHikService
.
getDao
().
insert
(
attRecord
);
}
catch
(
Exception
e
){
log
.
error
(
"异常"
,
e
);
}
}
}
/*
List<String> eventIds = attRecords.parallelStream().filter(f -> !ObjectUtils.isEmpty(f) && !ObjectUtils.isEmpty(f.getRemark())).map(i -> i.getRemark()).collect(Collectors.toList());
//查询当天考勤记录是否有重复的 有的 则不添加
AttendanceRecordHikQuery recordHikQuery = new AttendanceRecordHikQuery();
recordHikQuery.setAttendanceDateStart(DateUtil.format(DateUtil.beginOfDay(new Date()), "yyyy-MM-dd"));
recordHikQuery.setAttendanceDateEnd(DateUtil.format(DateUtil.beginOfDay(new Date()), "yyyy-MM-dd"));
recordHikQuery.setRemarkList(eventIds);
Set<String> eventIdSet = recordHikService.find(recordHikQuery).parallelStream().map(i -> i.getRemark()).collect(Collectors.toSet());
List<AttendanceRecordHikEntity> saveRecordList = attRecords.stream().filter(f -> !eventIdSet.contains(f.getRemark())).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(saveRecordList)) {
recordHikService.save(saveRecordList);
}
log.info("saveRecordList size:{}", saveRecordList.size());*/
}
// @GetMapping("webservice")@GetMapping("idGens")
@GetMapping
(
"updateDeptNum"
)
// public String idGens() {
@UnAuth
// log.info("测试id生成");
public
String
updateDeptNum
()
{
//
log
.
info
(
"更新部门用户数量"
);
// String stringId = idgeneratorService.getLongId(IdgeneratorServiceImpl.IdGeneratorKey.EFFECT).toString();
Map
<
Long
,
Long
>
collect
=
staffService
.
find
(
new
StaffQuery
()).
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getDeptId
(),
Collectors
.
counting
()));
//
//
DeptEntity
deptEntity1
=
new
DeptEntity
();
// return stringId;
deptEntity1
.
setPersonNum
(
0
);
// }
deptService
.
getDao
().
update
(
deptEntity1
,
new
HashMap
<>());
public
String
webservice
()
{
log
.
info
(
"测试"
);
collect
.
entrySet
().
stream
().
forEach
(
item
->
{
Long
deptId
=
item
.
getKey
();
Long
count
=
item
.
getValue
();
log
.
info
(
"deptId:{},num:{}"
,
deptId
,
count
);
DeptEntity
deptEntity
=
deptService
.
get
(
deptId
);
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
deptEntity
.
setPersonNum
(
count
.
intValue
());
deptService
.
update
(
deptEntity
);
}
});
for
(
Map
.
Entry
<
Long
,
Long
>
item
:
collect
.
entrySet
())
{
Long
deptId
=
item
.
getKey
();
if
(
deptId
==
-
1
)
continue
;
DeptEntity
deptEntity
=
deptService
.
get
(
deptId
);
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
//查询当前父节点的所有子部门
DeptQuery
deptQuery
=
new
DeptQuery
();
deptQuery
.
setParentId
(
deptEntity
.
getParentId
());
int
sum
=
deptService
.
find
(
new
DeptQuery
().
parentId
(
deptEntity
.
getParentId
())).
stream
().
map
(
i
->
i
.
getPersonNum
()).
reduce
(
0
,
Integer:
:
sum
);
;
DeptEntity
parentDept
=
deptService
.
get
(
deptEntity
.
getParentId
());
log
.
info
(
"dept:{},sum:{}"
,
parentDept
.
getDeptName
(),
sum
);
if
(!
ObjectUtils
.
isEmpty
(
parentDept
))
{
log
.
info
(
"parentDept:{},sum:{}"
,
parentDept
.
getDeptName
(),
sum
);
parentDept
.
setPersonNum
(
sum
);
deptService
.
update
(
parentDept
);
// updateDeptPersonNum(parentDept);
}
}
}
/*
//更新父部门的人数归集
collect.entrySet().stream().forEach(item -> {
Long deptId = item.getKey();
DeptEntity deptEntity = deptService.get(deptId);
if (!ObjectUtils.isEmpty(deptEntity) && !ObjectUtils.isEmpty(deptEntity.getParentId())) {
int sum = deptService.find(new DeptQuery().parentId(deptEntity.getId())).stream().mapToInt(i -> i.getPersonNum()).sum();
DeptEntity parentDept = deptService.get(deptEntity.getParentId());
if (ObjectUtils.isEmpty(parentDept)) {
parentDept.setPersonNum(sum);
deptService.update(parentDept);
updateDeptPersonNum(parentDept);
}
}
// updateDeptPersonNum(deptEntity);
});*/
return
"ok"
;
return
"ok"
;
}
}
public
static
void
calculateParentValue
(
DeptEntity
root
)
{
if
(
root
==
null
)
{
return
;
}
// 递归处理叶子节点
if
(
root
.
getChildren
().
isEmpty
())
{
return
;
}
// 递归计算所有子节点的值之和
int
sum
=
0
;
for
(
DeptEntity
child
:
root
.
getChildren
())
{
calculateParentValue
(
child
);
sum
+=
child
.
getPersonNum
();
}
// 更新当前节点的值为所有子节点值之和
root
.
setPersonNum
(
sum
);
}
private
void
updateDeptPersonNum
(
DeptEntity
deptEntity
)
{
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
)
&&
!
ObjectUtils
.
isEmpty
(
deptEntity
.
getParentId
()))
{
int
sum
=
deptService
.
find
(
new
DeptQuery
().
parentId
(
deptEntity
.
getId
())).
stream
().
mapToInt
(
i
->
i
.
getPersonNum
()).
sum
();
DeptEntity
parentDept
=
deptService
.
get
(
deptEntity
.
getParentId
());
if
(
ObjectUtils
.
isEmpty
(
parentDept
))
{
parentDept
.
setPersonNum
(
sum
);
deptService
.
update
(
parentDept
);
updateDeptPersonNum
(
parentDept
);
}
}
}
//
//
@GetMapping
(
"updatePersons"
)
@GetMapping
(
"updatePersons"
)
@UnAuth
@UnAuth
...
@@ -212,6 +431,7 @@ public class TestController {
...
@@ -212,6 +431,7 @@ public class TestController {
/**
/**
* 生成模拟数据
* 生成模拟数据
* mortals_xhx_perform_perpose_staff_stat
* mortals_xhx_perform_perpose_staff_stat
*
* @return
* @return
*/
*/
@GetMapping
(
"randomStatPerposeStaffData"
)
@GetMapping
(
"randomStatPerposeStaffData"
)
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestReq.java
0 → 100644
View file @
dfedd171
package
com.mortals.xhx.busiz
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
TestReq
{
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTimeStart
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTimeEnd
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
dfedd171
...
@@ -139,21 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -139,21 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
attendanceStatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
attendanceStatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
attendanceStatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
attendanceStatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
attendanceStatService
.
save
(
attendanceStatEntity
);
attendanceStatService
.
save
(
attendanceStatEntity
);
//统计各级部门员工数量 todo 优化统计
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
.
getAncestors
()))
{
String
[]
split
=
deptEntity
.
getAncestors
().
split
(
","
,
2
);
if
(
split
.
length
>
1
)
{
String
ancestor
=
split
[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
for
(
String
newAncestor
:
ancestors
)
{
DeptEntity
deptEntity2
=
deptService
.
get
(
Long
.
valueOf
(
newAncestor
));
if
(
Objects
.
nonNull
(
deptEntity2
))
{
deptEntity2
.
setPersonNum
(
deptEntity2
.
getPersonNum
()
+
1
);
deptService
.
update
(
deptEntity2
);
}
}
}
}
}
else
{
}
else
{
//更新
//更新
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
...
@@ -170,21 +156,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -170,21 +156,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity
.
setUpdateUserId
(
1L
);
staffEntity
.
setUpdateUserId
(
1L
);
staffEntity
.
setUpdateTime
(
new
Date
());
staffEntity
.
setUpdateTime
(
new
Date
());
staffService
.
update
(
staffEntity
);
staffService
.
update
(
staffEntity
);
//统计各级部门员工数量
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
.
getAncestors
()))
{
String
[]
split
=
deptEntity
.
getAncestors
().
split
(
","
,
2
);
if
(
split
.
length
>
1
){
String
ancestor
=
split
[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
for
(
String
newAncestor
:
ancestors
)
{
DeptEntity
deptEntity2
=
deptService
.
get
(
Long
.
valueOf
(
newAncestor
));
if
(
Objects
.
nonNull
(
deptEntity2
))
{
deptEntity2
.
setPersonNum
(
deptEntity2
.
getPersonNum
()
+
1
);
deptService
.
update
(
deptEntity2
);
}
}
}
}
}
}
}
}
}
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/AttendanceRecordHikService.java
View file @
dfedd171
package
com.mortals.xhx.module.attendance.service
;
package
com.mortals.xhx.module.attendance.service
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.attendance.dao.AttendanceRecordHikDao
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity
;
/**
/**
...
@@ -13,6 +14,8 @@ import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
...
@@ -13,6 +14,8 @@ import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
*/
*/
public
interface
AttendanceRecordHikService
extends
ICRUDService
<
AttendanceRecordHikEntity
,
Long
>{
public
interface
AttendanceRecordHikService
extends
ICRUDService
<
AttendanceRecordHikEntity
,
Long
>{
AttendanceRecordHikDao
getDao
();
/**
/**
* 将原始数据导入打卡记录表
* 将原始数据导入打卡记录表
* @param entity
* @param entity
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
View file @
dfedd171
package
com.mortals.xhx.module.dept.service
;
package
com.mortals.xhx.module.dept.service
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.dept.dao.DeptDao
;
import
com.mortals.xhx.module.dept.model.DeptEntity
;
import
com.mortals.xhx.module.dept.model.DeptEntity
;
import
com.mortals.xhx.module.dept.model.DeptTreeSelect
;
import
com.mortals.xhx.module.dept.model.DeptTreeSelect
;
...
@@ -15,6 +16,8 @@ import java.util.List;
...
@@ -15,6 +16,8 @@ import java.util.List;
*/
*/
public
interface
DeptService
extends
ICRUDService
<
DeptEntity
,
Long
>{
public
interface
DeptService
extends
ICRUDService
<
DeptEntity
,
Long
>{
DeptDao
getDao
();
/**
/**
* 是否存在部门信息节点
* 是否存在部门信息节点
*
*
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/AbstractDingTalkService.java
View file @
dfedd171
...
@@ -52,6 +52,12 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
...
@@ -52,6 +52,12 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
@Value
(
"${dingtalk.AppSecret:''}"
)
@Value
(
"${dingtalk.AppSecret:''}"
)
protected
String
appSecret
;
protected
String
appSecret
;
/**
* appKey
*/
@Value
(
"${dingtalk.oaUrl:}"
)
protected
String
oaUrl
;
@Autowired
@Autowired
private
ICacheService
cacheService
;
private
ICacheService
cacheService
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dingding/personal/service/impl/DingPersonServiceImpl.java
View file @
dfedd171
...
@@ -120,9 +120,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
...
@@ -120,9 +120,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
*/
*/
public
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
createClient
()
throws
Exception
{
public
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
createClient
()
throws
Exception
{
com
.
aliyun
.
teaopenapi
.
models
.
Config
config
=
new
com
.
aliyun
.
teaopenapi
.
models
.
Config
();
com
.
aliyun
.
teaopenapi
.
models
.
Config
config
=
new
com
.
aliyun
.
teaopenapi
.
models
.
Config
();
config
.
protocol
=
"https"
;
//config.protocol = "https";
config
.
protocol
=
"http"
;
config
.
regionId
=
"central"
;
config
.
regionId
=
"central"
;
// config.endpoint = domain.replace("http://", "");
// config.endpoint = domain.replace("http://", "");
config
.
endpoint
=
oaUrl
;
return
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
(
config
);
return
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
(
config
);
}
}
...
@@ -132,11 +134,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
...
@@ -132,11 +134,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
client
=
createClient
();
com
.
aliyun
.
dingtalkworkflow_1_0
.
Client
client
=
createClient
();
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
getProcessInstanceHeaders
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
();
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
getProcessInstanceHeaders
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceHeaders
();
getProcessInstanceHeaders
.
xAcsDingtalkAccessToken
=
getToken
();
getProcessInstanceHeaders
.
xAcsDingtalkAccessToken
=
getToken
();
/*
HashMap<String, String> map = new HashMap<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
getProcessInstanceHeaders
.
setCommonHeaders
(
map
);
getProcessInstanceHeaders
.
setCommonHeaders
(
map
);
getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113");
getProcessInstanceHeaders
.
getCommonHeaders
().
put
(
"host"
,
"172.15.28.113
:8919
"
);
getProcessInstanceHeaders.getCommonHeaders().put("port", "8918
");
// getProcessInstanceHeaders.getCommonHeaders().put("port", "8919
");
getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");*/
// getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceRequest
getProcessInstanceRequest
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceRequest
()
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceRequest
getProcessInstanceRequest
=
new
com
.
aliyun
.
dingtalkworkflow_1_0
.
models
.
GetProcessInstanceRequest
()
.
setProcessInstanceId
(
processInstanceId
);
.
setProcessInstanceId
(
processInstanceId
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/AbstractHikService.java
View file @
dfedd171
...
@@ -8,7 +8,7 @@ import java.util.Map;
...
@@ -8,7 +8,7 @@ import java.util.Map;
public
abstract
class
AbstractHikService
{
public
abstract
class
AbstractHikService
{
@Value
(
"${hik.host:
''
}"
)
@Value
(
"${hik.host:}"
)
protected
String
host
;
protected
String
host
;
@Value
(
"${hik.appKey:''}"
)
@Value
(
"${hik.appKey:''}"
)
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/web/JobController.java
View file @
dfedd171
...
@@ -42,7 +42,7 @@ public class JobController extends BaseCRUDJsonBodyMappingController<JobService,
...
@@ -42,7 +42,7 @@ public class JobController extends BaseCRUDJsonBodyMappingController<JobService,
@Override
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"type"
,
JobTypeEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"type"
,
JobTypeEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"group"
,
service
.
queryGroupName
(
new
JobQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getGroupName
(),(
o
,
n
)->
n
)));
this
.
addDict
(
model
,
"group
Id
"
,
service
.
queryGroupName
(
new
JobQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getGroupName
(),(
o
,
n
)->
n
)));
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
...
...
attendance-performance-manager/src/main/resources/bootstrap.yml
View file @
dfedd171
...
@@ -74,4 +74,5 @@ dingtalk:
...
@@ -74,4 +74,5 @@ dingtalk:
AppSecret
:
@
profiles.dingtalk.appSecret@
AppSecret
:
@
profiles.dingtalk.appSecret@
AesKey
:
@
profiles.dingtalk.aesKey@
AesKey
:
@
profiles.dingtalk.aesKey@
token
:
@
profiles.dingtalk.token@
token
:
@
profiles.dingtalk.token@
oaUrl
:
@
profiles.dingtalk.oaUrl@
attendance-performance-manager/src/main/resources/config/mybatis-sqlmap-config.xml
View file @
dfedd171
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<plugin
interceptor=
"com.mortals.framework.thirty.mybatis.LogInterceptor"
>
<plugin
interceptor=
"com.mortals.framework.thirty.mybatis.LogInterceptor"
>
<property
name=
"enableExecutorTime"
value=
"true"
/>
<property
name=
"enableExecutorTime"
value=
"true"
/>
<property
name=
"showSql"
value=
"
tru
e"
/>
<property
name=
"showSql"
value=
"
fals
e"
/>
</plugin>
</plugin>
</plugins>
</plugins>
</configuration>
</configuration>
\ No newline at end of file
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