diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/query/InspectionListQuery.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/query/InspectionListQuery.java index 942d89c7..35a5ff1c 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/query/InspectionListQuery.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/query/InspectionListQuery.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.query; import lombok.Data; +import java.util.List; + @Data public class InspectionListQuery { @@ -14,4 +16,24 @@ public class InspectionListQuery { * 客户来源 */ private String customerSource; + + /** + * 时间范围 + */ + private List datetimeRange; + + /** + * 客户来源 + */ + private String customSource; + + /** + * 业务 + */ + private String bussiness; + + /** + * 项目id + */ + private String projectId; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 198af000..725b38e1 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1554,7 +1554,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl userList = userService.list(Wrappers.lambdaQuery() - .in(AdminUserDO::getId,userIds)); // 你需新增 getUsers(Collection ids) + .in(AdminUserDO::getId, userIds)); // 你需新增 getUsers(Collection ids) //转为map Map userMap = userList.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity())); @@ -1565,7 +1565,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl workerInspectionList(Long workerId, String status, String searchValue) { return baseMapper.workerInspectionList(workerId, status, searchValue); @@ -2030,7 +2028,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl> res = baseMapper.staticsTable3(partnerId, startTime, endTime); - List> res = baseMapper.selectBusinessStatistics( startTime, endTime); + List> res = baseMapper.selectBusinessStatistics(startTime, endTime); return res; } @@ -2315,11 +2313,26 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl> children = (List>) stringObjectMap.get("children"); stringObjectMap.put("meetCarCount", meetManIdCountMap.get(userId)); + stringObjectMap.put("totalCount", (Long) stringObjectMap.get("totalCount") == null ? 0 : (Long) stringObjectMap.get("totalCount") + (meetManIdCountMap.get(userId) == null ? 0 : meetManIdCountMap.get(userId))); HashMap objectObjectHashMap = new HashMap<>(); objectObjectHashMap.put("count", meetManIdCountMap.get(userId) == null ? 0 : meetManIdCountMap.get(userId)); objectObjectHashMap.put("projectName", "接车"); children.add(objectObjectHashMap); } + // 按 meetCarCount 降序排序员工 + staffCount.sort(Comparator.comparingLong( + (Map staff) -> (Long) staff.getOrDefault("totalCount", 0L) + ).reversed()); + + // 对每个员工的 children 按 count 降序排序 + staffCount.forEach(staff -> { + List> children = (List>) staff.get("children"); + if (children != null) { + children.sort(Comparator.comparingLong( + (Map child) -> (Long) child.getOrDefault("count", 0L) + ).reversed()); + } + }); return staffCount; } @@ -2331,7 +2344,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl fileStatistics(String servicePackageId,String startTime, String endTime) { + public Map fileStatistics(String servicePackageId, String startTime, String endTime) { // 判断开始时间与结束时间如果为空 默认查询本月 if (StringUtils.isEmpty(startTime)) { startTime = DateUtil.format(DateUtil.beginOfMonth(new Date()), "yyyy-MM-dd"); @@ -2340,7 +2353,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpllambdaQuery() - .eq(InspectionFile::getServicePackageId, servicePackageId) + .eq(InspectionFile::getServicePackageId, servicePackageId) .between(InspectionFile::getCreateTime, startTime, endTime)); // 查询文件记录表 diff --git a/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml b/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml index 49d868ac..a0e37ea9 100644 --- a/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml @@ -322,7 +322,18 @@ AND ii.customer_source = #{query.customerSource} - + + AND ii.create_time BETWEEN #{query.datetimeRange[0]} AND #{query.datetimeRange[1]} + + + AND ii.customer_source = #{query.customSource} + + + AND ii.business_channel = #{query.bussiness} + + + AND ip.id = #{query.projectId} + AND iwn.status = '2' AND iwn.deleted = b'0'