This commit is contained in:
xyc 2025-06-06 10:47:57 +08:00
parent e4346ad141
commit 735f26ed3c
3 changed files with 54 additions and 8 deletions

View File

@ -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<String> datetimeRange;
/**
* 客户来源
*/
private String customSource;
/**
* 业务
*/
private String bussiness;
/**
* 项目id
*/
private String projectId;
}

View File

@ -1554,7 +1554,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
if (info.getMeetManId() != null) userIds.add(info.getMeetManId());
List<AdminUserDO> userList = userService.list(Wrappers.<AdminUserDO>lambdaQuery()
.in(AdminUserDO::getId,userIds)); // 你需新增 getUsers(Collection<Long> ids)
.in(AdminUserDO::getId, userIds)); // 你需新增 getUsers(Collection<Long> ids)
//转为map
Map<Long, AdminUserDO> userMap = userList.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity()));
@ -1565,7 +1565,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
AdminUserDO meetMan = userMap.get(info.getMeetManId());
InspectionInfoVo res = new InspectionInfoVo();
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
res.setInspectionId(info.getId());
res.setBuyUserName(buyUser != null ? buyUser.getNickname() : "");
@ -1600,7 +1600,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
}
if (leadMan != null) {
res.setLeadManName(leadMan.getNickname());
res.setLeadManId(leadMan.getId());
@ -1676,7 +1675,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
}
@Override
public List<InspectionInfo> workerInspectionList(Long workerId, String status, String searchValue) {
return baseMapper.workerInspectionList(workerId, status, searchValue);
@ -2030,7 +2028,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
// List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
List<Map<String, Object>> res = baseMapper.selectBusinessStatistics( startTime, endTime);
List<Map<String, Object>> res = baseMapper.selectBusinessStatistics(startTime, endTime);
return res;
}
@ -2315,11 +2313,26 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
Long userId = (Long) stringObjectMap.get("userId");
List<Map<String, Object>> children = (List<Map<String, Object>>) 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<String, Object> 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<String, Object> staff) -> (Long) staff.getOrDefault("totalCount", 0L)
).reversed());
// 对每个员工的 children count 降序排序
staffCount.forEach(staff -> {
List<Map<String, Object>> children = (List<Map<String, Object>>) staff.get("children");
if (children != null) {
children.sort(Comparator.comparingLong(
(Map<String, Object> child) -> (Long) child.getOrDefault("count", 0L)
).reversed());
}
});
return staffCount;
}
@ -2331,7 +2344,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
* @return 结果
*/
@Override
public Map<String, Object> fileStatistics(String servicePackageId,String startTime, String endTime) {
public Map<String, Object> 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 ServiceImpl<AppInspectionPa
endTime = DateUtil.format(DateUtil.endOfMonth(new Date()), "yyyy-MM-dd");
}
long addCount = inspectionFileService.count(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getServicePackageId, servicePackageId)
.eq(InspectionFile::getServicePackageId, servicePackageId)
.between(InspectionFile::getCreateTime, startTime, endTime));
// 查询文件记录表

View File

@ -322,7 +322,18 @@
<if test="query.customerSource != null">
AND ii.customer_source = #{query.customerSource}
</if>
<if test="query.datetimeRange != null">
AND ii.create_time BETWEEN #{query.datetimeRange[0]} AND #{query.datetimeRange[1]}
</if>
<if test="query.customSource != null">
AND ii.customer_source = #{query.customSource}
</if>
<if test="query.bussiness != null">
AND ii.business_channel = #{query.bussiness}
</if>
<if test="query.projectId != null">
AND ip.id = #{query.projectId}
</if>
AND iwn.status = '2'
AND iwn.deleted = b'0'
</where>