Commit 5aff06926599aaf520022cb4d1a7e6098e82ccb9

Authored by 王彪总
1 parent 6e4288c8

feat(garden): 添加个人历史完成率配置和个人任务效率统计功能

- 在DictTypeConstants中新增COMPLETION_RATE_CONFIG字典类型用于个人历史完成率配置
- 在TaskDistanceSortRespVO中添加historyCompletionRate字段用于存储个人历史完成率
- 在UserTaskEfficiencyDO中添加historyCompletionRate字段用于存储个人历史完成率
- 在HomepageSummaryServiceImpl的多个方法中加载效率数据并设置个人历史完成率
- 在TaskEfficiencyCalculateJob中实现个人历史完成率计算逻辑
- 在UserTaskEfficiencyMapper中添加statHistoryTotalCount查询方法
- 在MyBatis映射文件中添加统计用户6个月历史任务总量的SQL
- 在RoadApiImpl中为getRoadInfoById方法禁用数据权限注解
- 将应用环境配置从dev切换到prod模式
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/user/AdminUserServiceImpl.java
@@ -671,28 +671,28 @@ public class AdminUserServiceImpl implements AdminUserService { @@ -671,28 +671,28 @@ public class AdminUserServiceImpl implements AdminUserService {
671 if (deptId == null) { 671 if (deptId == null) {
672 return null; 672 return null;
673 } 673 }
674 - 674 +
675 DeptDO dept = deptService.getDept(deptId); 675 DeptDO dept = deptService.getDept(deptId);
676 if (dept == null) { 676 if (dept == null) {
677 return null; 677 return null;
678 } 678 }
679 - 679 +
680 // 顶级部门ID (parentId=0) 680 // 顶级部门ID (parentId=0)
681 if (dept.getParentId().equals(0L)) { 681 if (dept.getParentId().equals(0L)) {
682 return dept.getId(); 682 return dept.getId();
683 } 683 }
684 - 684 +
685 // 直接是二级部门 (parentId=100) 685 // 直接是二级部门 (parentId=100)
686 if (dept.getParentId().equals(100L)) { 686 if (dept.getParentId().equals(100L)) {
687 return dept.getId(); 687 return dept.getId();
688 } 688 }
689 - 689 +
690 // 递归查找父部门链中parentId=100的部门 690 // 递归查找父部门链中parentId=100的部门
691 Long result = findParentDeptWithParentId(dept.getParentId(), 100L); 691 Long result = findParentDeptWithParentId(dept.getParentId(), 100L);
692 // 如果找不到parentId=100的部门,返回当前部门的id作为默认值 692 // 如果找不到parentId=100的部门,返回当前部门的id作为默认值
693 return result != null ? result : dept.getParentId(); 693 return result != null ? result : dept.getParentId();
694 } 694 }
695 - 695 +
696 /** 696 /**
697 * 递归查找父部门链中parentId等于目标值的部门ID 697 * 递归查找父部门链中parentId等于目标值的部门ID
698 * @param currentDeptId 当前部门ID 698 * @param currentDeptId 当前部门ID
@@ -703,22 +703,22 @@ public class AdminUserServiceImpl implements AdminUserService { @@ -703,22 +703,22 @@ public class AdminUserServiceImpl implements AdminUserService {
703 if (currentDeptId == null) { 703 if (currentDeptId == null) {
704 return null; 704 return null;
705 } 705 }
706 - 706 +
707 DeptDO dept = deptService.getDept(currentDeptId); 707 DeptDO dept = deptService.getDept(currentDeptId);
708 if (dept == null) { 708 if (dept == null) {
709 return null; 709 return null;
710 } 710 }
711 - 711 +
712 // 找到目标父部门 712 // 找到目标父部门
713 if (dept.getParentId().equals(targetParentId)) { 713 if (dept.getParentId().equals(targetParentId)) {
714 return dept.getId(); 714 return dept.getId();
715 } 715 }
716 - 716 +
717 // 达到顶级部门,停止递归 717 // 达到顶级部门,停止递归
718 if (dept.getParentId().equals(0L)) { 718 if (dept.getParentId().equals(0L)) {
719 return dept.getId(); // 改为返回顶级部门ID,而不是null 719 return dept.getId(); // 改为返回顶级部门ID,而不是null
720 } 720 }
721 - 721 +
722 // 继续向上查找 722 // 继续向上查找
723 return findParentDeptWithParentId(dept.getParentId(), targetParentId); 723 return findParentDeptWithParentId(dept.getParentId(), targetParentId);
724 } 724 }