Commit 77f18581 authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 89fb7c26
......@@ -68,6 +68,7 @@
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<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.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
......@@ -98,6 +99,7 @@
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<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.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
......
......@@ -93,10 +93,14 @@ public class TestController {
log.info("更新部门用户数量");
Map<Long, Long> collect = staffService.find(new StaffQuery()).stream().collect(Collectors.groupingBy(x -> x.getDeptId(), Collectors.counting()));
DeptEntity deptEntity1 = new DeptEntity();
deptEntity1.setPersonNum(0);
deptService.getDao().update(deptEntity1,new HashMap<>());
collect.entrySet().stream().forEach(item -> {
Long deptId = item.getKey();
Long count = item.getValue();
log.info("dept:{},num:{}",deptId,count);
log.info("deptId:{},num:{}", deptId, count);
DeptEntity deptEntity = deptService.get(deptId);
if (!ObjectUtils.isEmpty(deptEntity)) {
deptEntity.setPersonNum(count.intValue());
......@@ -114,7 +118,7 @@ public class TestController {
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());
log.info("dept:{},num:{}",parentDept.getDeptName(),sum);
log.info("dept:{},sum:{}", parentDept.getDeptName(), sum);
if (ObjectUtils.isEmpty(parentDept)) {
parentDept.setPersonNum(sum);
......
package com.mortals.xhx.module.dept.service;
import com.mortals.framework.model.Context;
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.DeptTreeSelect;
......@@ -15,6 +16,8 @@ import java.util.List;
*/
public interface DeptService extends ICRUDService<DeptEntity,Long>{
DeptDao getDao();
/**
* 是否存在部门信息节点
*
......
......@@ -74,4 +74,5 @@ dingtalk:
AppSecret: @profiles.dingtalk.appSecret@
AesKey: @profiles.dingtalk.aesKey@
token: @profiles.dingtalk.token@
oaUrl: @profiles.dingtalk.oaUrl@
......@@ -20,7 +20,7 @@
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" />
<property name="showSql" value="true" />
<property name="showSql" value="false" />
</plugin>
</plugins>
</configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment