Compare commits

..

No commits in common. "09ed6e67487ecddbc900ec07e17df400a970b629" and "5cdfa9b3e58b17b767d3f9ee134f5df540f35357" have entirely different histories.

13 changed files with 26 additions and 111 deletions

View File

@ -167,7 +167,6 @@ public class InspectionInfo extends TenantBaseDO
private Long returnCarUserId; private Long returnCarUserId;
/** 是否还车 */ /** 是否还车 */
private Integer isReturnCar; private Integer isReturnCar;
private Integer returnType;
/** 开始检测时需要 传入 选择项目的id、角色id、排序 */ /** 开始检测时需要 传入 选择项目的id、角色id、排序 */
@TableField(exist = false) @TableField(exist = false)
@ -208,8 +207,4 @@ public class InspectionInfo extends TenantBaseDO
private String appointmentDay; // 经度 private String appointmentDay; // 经度
@TableField(exist = false) @TableField(exist = false)
private String appointmentTime; // 经度 private String appointmentTime; // 经度
@TableField(exist = false)
private Integer meetType;
@TableField(exist = false)
private String content;
} }

View File

@ -115,7 +115,4 @@ public class InspectionWorkNode extends TenantBaseDO {
private String meetCarId; private String meetCarId;
@TableField(exist = false) @TableField(exist = false)
private List<String> idList; private List<String> idList;
/** 退车时传的退车类型*/
@TableField(exist = false)
private Integer returnType;
} }

View File

@ -97,6 +97,4 @@ public interface InspectionInfoMapper extends BaseMapper<InspectionInfo>
IPage<InspectionInfo> geStelectInspectionByBusiness(@Param("page") Page<InspectionInfo> page,@Param("info") InspectionInfo inspectionInfo); IPage<InspectionInfo> geStelectInspectionByBusiness(@Param("page") Page<InspectionInfo> page,@Param("info") InspectionInfo inspectionInfo);
List<InspectionInfo> selectMeetCarList();
} }

View File

@ -175,6 +175,4 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
IPage<InspectionInfo> geStelectInspectionByBusiness(Page<InspectionInfo> page, InspectionInfo inspectionInfo); IPage<InspectionInfo> geStelectInspectionByBusiness(Page<InspectionInfo> page, InspectionInfo inspectionInfo);
Map<String, Long> getBusinessCountByType(Integer partnerId); Map<String, Long> getBusinessCountByType(Integer partnerId);
List<InspectionInfo> selectMeetCarList();
} }

View File

@ -2302,71 +2302,37 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) { public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) {
List<Map<String, Object>> staffCount = inspectionWorkNodeService.getStaffCount(dlInspectionProject); List<Map<String, Object>> staffCount = inspectionWorkNodeService.getStaffCount(dlInspectionProject);
// 根据userId查询检测工单表 接车人 // 根据userId查询检测工单表 接车人
List<InspectionInfo> list = inspectionInfoService.selectMeetCarList(); List<InspectionInfo> list = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery()
.eq(InspectionInfo::getIsMeetCar, 1));
// 统计每个 meetManId 的数量避免 null key 异常 // 统计每个 meetManId 的数量避免 null key 异常
Map<Long, List<InspectionInfo>> meetManIdCountMap = list.stream() Map<Long, Long> meetManIdCountMap = list.stream()
.filter(info -> info.getMeetManId() != null) // 过滤 null .filter(info -> info.getMeetManId() != null) // 过滤 null
.collect(Collectors.groupingBy(InspectionInfo::getMeetManId)); .collect(Collectors.groupingBy(InspectionInfo::getMeetManId, Collectors.counting()));
// 根据userId查询还车人 // 根据userId查询还车人
List<InspectionInfo> returnCarList = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery() List<InspectionInfo> returnCarList = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery()
.eq(InspectionInfo::getIsReturnCar, 1) .eq(InspectionInfo::getIsReturnCar, 1));
.between(CollUtil.isNotEmpty(dlInspectionProject.getDatetimeRange()), InspectionInfo::getEndTime, dlInspectionProject.getDatetimeRange().get(0), dlInspectionProject.getDatetimeRange().get(1)));
// 统计每个 returnCarUserId 的数量避免 null key 异常 // 统计每个 returnCarUserId 的数量避免 null key 异常
Map<Long, List<InspectionInfo>> returnCarUserIdCountMap = returnCarList.stream() Map<Long, Long> returnCarUserIdCountMap = returnCarList.stream()
.filter(info -> info.getReturnCarUserId() != null) // 过滤 null .filter(info -> info.getReturnCarUserId() != null) // 过滤 null
.collect(Collectors.groupingBy(InspectionInfo::getReturnCarUserId)); .collect(Collectors.groupingBy(InspectionInfo::getReturnCarUserId, Collectors.counting()));
for (Map<String, Object> stringObjectMap : staffCount) { for (Map<String, Object> stringObjectMap : staffCount) {
Long userId = (Long) stringObjectMap.get("userId"); Long userId = (Long) stringObjectMap.get("userId");
List<Map<String, Object>> children = (List<Map<String, Object>>) stringObjectMap.get("children"); List<Map<String, Object>> children = (List<Map<String, Object>>) stringObjectMap.get("children");
// stringObjectMap.put("meetCarCount", meetManIdCountMap.get(userId)); // 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)));
List<InspectionInfo> inspectionInfos = meetManIdCountMap.get(userId);
stringObjectMap.put("totalCount", (Long) stringObjectMap.get("totalCount") == null ? 0 : (Long) stringObjectMap.get("totalCount") + (meetManIdCountMap.get(userId) == null ? 0 : meetManIdCountMap.get(userId).size()));
long meetCount = 0;
long meetGoCount = 0;
if (CollUtil.isNotEmpty(inspectionInfos)) {
meetCount = inspectionInfos.stream().filter(inspectionInfo -> Integer.valueOf(0).equals(inspectionInfo.getMeetType())).count();
meetGoCount = inspectionInfos.stream().filter(inspectionInfo -> Integer.valueOf(1).equals(inspectionInfo.getMeetType())).count();
}
HashMap<String, Object> objectObjectHashMap = new HashMap<>(); HashMap<String, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("count", meetCount); objectObjectHashMap.put("count", meetManIdCountMap.get(userId) == null ? 0 : meetManIdCountMap.get(userId));
objectObjectHashMap.put("projectName", "接车拍照"); objectObjectHashMap.put("projectName", "接车");
children.add(objectObjectHashMap);
HashMap<String, Object> meetCarHashMap = new HashMap<>();
meetCarHashMap.put("count", meetGoCount);
meetCarHashMap.put("projectName", "上门接车");
children.add(meetCarHashMap); children.add(objectObjectHashMap);
//还车 //还车
//设置totalCount //设置totalCount
List<InspectionInfo> returnCarInfoList = returnCarUserIdCountMap.get(userId); stringObjectMap.put("totalCount", (Long) stringObjectMap.get("totalCount") == null ? 0 : (Long) stringObjectMap.get("totalCount") + (returnCarUserIdCountMap.get(userId) == null ? 0 : returnCarUserIdCountMap.get(userId)));
long returnCount = 0;
long returnGoCount = 0;
if (CollUtil.isNotEmpty(returnCarInfoList)) {
returnCount = Optional.ofNullable(returnCarInfoList)
.orElse(Collections.emptyList())
.stream()
.filter(Objects::nonNull)
.filter(i -> i.getReturnType() != null && i.getReturnType() == 0)
.count();
returnGoCount = Optional.ofNullable(returnCarInfoList)
.orElse(Collections.emptyList())
.stream()
.filter(Objects::nonNull)
.filter(i -> i.getReturnType() != null && i.getReturnType() == 1)
.count();
}
stringObjectMap.put("totalCount", (Long) stringObjectMap.get("totalCount") == null ? 0 : (Long) stringObjectMap.get("totalCount") + (returnCarUserIdCountMap.get(userId) == null ? 0 : returnCarUserIdCountMap.get(userId).size()));
Map<String, Object> objectObjectHashMap1 = new HashMap<>(); Map<String, Object> objectObjectHashMap1 = new HashMap<>();
objectObjectHashMap1.put("count", returnCount); objectObjectHashMap1.put("count", returnCarUserIdCountMap.get(userId) == null ? 0 : returnCarUserIdCountMap.get(userId));
objectObjectHashMap1.put("projectName", "还车拍照"); objectObjectHashMap1.put("projectName", "还车");
children.add(objectObjectHashMap1); children.add(objectObjectHashMap1);
Map<String, Object> returnCarHashMap = new HashMap<>();
returnCarHashMap.put("count", returnGoCount);
returnCarHashMap.put("projectName", "上门还车");
children.add(returnCarHashMap);
} }
// meetCarCount 降序排序员工 // meetCarCount 降序排序员工
staffCount.sort(Comparator.comparingLong( staffCount.sort(Comparator.comparingLong(

View File

@ -561,6 +561,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
saveLeadRecord(inspectionInfo.getId(), inspectionInfo.getMeetManId()); saveLeadRecord(inspectionInfo.getId(), inspectionInfo.getMeetManId());
// // 发送站内信 // // 发送站内信
// String msg = String.format(InspectionConstants.INSPECTION_NOTICE_TEMPLATE_ASSIGN_STAFF_MEET_CAR, info.get("day"), inspectionInfo.getCarNum()); // String msg = String.format(InspectionConstants.INSPECTION_NOTICE_TEMPLATE_ASSIGN_STAFF_MEET_CAR, info.get("day"), inspectionInfo.getCarNum());
// noticeService.sentMessage(inspectionInfo.getLeadManId(), msg); // noticeService.sentMessage(inspectionInfo.getLeadManId(), msg);
@ -949,13 +950,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
//存入步骤表 //存入步骤表
InspectionStepInfo stepInfo = new InspectionStepInfo(); InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(inspectionWorkNode.getInspectionInfoId()); stepInfo.setInspectionInfoId(inspectionWorkNode.getInspectionInfoId());
String title = "还车拍照"; stepInfo.setTitle("还车拍照");
if (inspectionWorkNode.getReturnType() == 0 ){
title = "还车拍照";
} else if (inspectionWorkNode.getReturnType() == 1) {
title = "上门还车";
}
stepInfo.setTitle(title);
stepInfo.setContent(remark); stepInfo.setContent(remark);
stepInfo.setImages(dealImages); stepInfo.setImages(dealImages);
stepInfo.setCreator(Math.toIntExact(SecurityFrameworkUtils.getLoginUserId())); stepInfo.setCreator(Math.toIntExact(SecurityFrameworkUtils.getLoginUserId()));
@ -969,7 +964,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
int update = baseMapper.update(Wrappers.<InspectionInfo>lambdaUpdate() int update = baseMapper.update(Wrappers.<InspectionInfo>lambdaUpdate()
.eq(InspectionInfo::getId, inspectionWorkNode.getInspectionInfoId()) .eq(InspectionInfo::getId, inspectionWorkNode.getInspectionInfoId())
.set(InspectionInfo::getIsReturnCar, InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_YES) .set(InspectionInfo::getIsReturnCar, InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_YES)
.set(InspectionInfo::getReturnType, inspectionWorkNode.getReturnType())
.set(InspectionInfo::getReturnCarUserId, SecurityFrameworkUtils.getLoginUserId())); .set(InspectionInfo::getReturnCarUserId, SecurityFrameworkUtils.getLoginUserId()));
return true; return true;
} }
@ -1066,14 +1060,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
} }
} }
/**
* @return
*/
@Override
public List<InspectionInfo> selectMeetCarList() {
return baseMapper.selectMeetCarList();
}
/** /**
* 保存引车员记录 * 保存引车员记录
* *

View File

@ -121,19 +121,13 @@ public class InspectionMeetCarOrderServiceImpl extends ServiceImpl<InspectionMee
} }
if (StrUtil.isNotEmpty(order.getContent()) || StrUtil.isNotEmpty(order.getImages())) { if (StrUtil.isNotEmpty(order.getContent()) || StrUtil.isNotEmpty(order.getImages())) {
String title = "接车拍照";
if (order.getMeetType() == 0) {
title = "接车拍照";
} else if (order.getMeetType() == 1) {
title = "上门接车";
}
// 在步骤表里添加一条记录 // 在步骤表里添加一条记录
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
inspectionStepInfo.setInspectionInfoId(order.getId()); inspectionStepInfo.setInspectionInfoId(order.getId());
//设置开始时间 //设置开始时间
inspectionStepInfo.setCreateTime(DateUtil.date()); inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); inspectionStepInfo.setCreator(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + ""));
inspectionStepInfo.setTitle(title); inspectionStepInfo.setTitle("接车拍照");
inspectionStepInfo.setContent(order.getContent()); inspectionStepInfo.setContent(order.getContent());
inspectionStepInfo.setImages(order.getImages()); inspectionStepInfo.setImages(order.getImages());
inspectionStepInfo.setStepNum(1); inspectionStepInfo.setStepNum(1);

View File

@ -143,12 +143,6 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
@Override @Override
public InspectionStaffSaveVo get(Long id) { public InspectionStaffSaveVo get(Long id) {
InspectionStaffSaveVo inspectionStaffSaveVo = baseMapper.get(id); InspectionStaffSaveVo inspectionStaffSaveVo = baseMapper.get(id);
if (inspectionStaffSaveVo == null) {
// 创建子表
inspectionStaffSaveVo = new InspectionStaffSaveVo();
inspectionStaffSaveVo.setUserId(id);
baseMapper.insert(inspectionStaffSaveVo);
}
if (inspectionStaffSaveVo == null) { if (inspectionStaffSaveVo == null) {
return null; return null;
} }

View File

@ -457,9 +457,6 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
// 添加项目 // 添加项目
List<Map<String, Object>> children = (List<Map<String, Object>>) userEntry.get("children"); List<Map<String, Object>> children = (List<Map<String, Object>>) userEntry.get("children");
if (vo.getCount() == 0) {
continue;
}
Map<String, Object> project = new HashMap<>(); Map<String, Object> project = new HashMap<>();
project.put("projectName", vo.getProjectName()); project.put("projectName", vo.getProjectName());
project.put("count", vo.getCount()); project.put("count", vo.getCount());
@ -480,6 +477,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
}) })
.sorted((a, b) -> Long.compare((Long) b.get("totalCount"), (Long) a.get("totalCount"))) .sorted((a, b) -> Long.compare((Long) b.get("totalCount"), (Long) a.get("totalCount")))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/** /**

View File

@ -9,5 +9,4 @@ public class StaffProjectCountVO {
private Long count; private Long count;
private String nickname; private String nickname;
private String projectName; private String projectName;
private Long nodeCount;
} }

View File

@ -246,13 +246,10 @@
ip.project_name, ip.project_name,
is2.user_id, is2.user_id,
su.nickname, su.nickname,
COUNT(iwn.id) AS count, COUNT(iwn.id) AS count
SUM(iwn.node_count) AS nodeCount
FROM inspection_staff is2 FROM inspection_staff is2
CROSS JOIN inspection_project ip CROSS JOIN inspection_project ip
LEFT JOIN system_users su ON su.id = is2.user_id LEFT JOIN system_users su ON su.id = is2.user_id
left join system_user_role sr on su.id = sr.user_id
left join system_role sr2 on sr.role_id = sr2.id
LEFT JOIN inspection_work_node iwn ON LEFT JOIN inspection_work_node iwn ON
iwn.deal_user_id = is2.user_id iwn.deal_user_id = is2.user_id
AND iwn.project_id = ip.id AND iwn.project_id = ip.id
@ -261,7 +258,7 @@
</if> </if>
WHERE WHERE
is2.deleted = 0 is2.deleted = 0
AND su.deleted = 0 and sr2.service_package_id = 'jiance' and sr2.code != 'jcyh' and sr2.code != 'jcywjl' AND ip.deleted = 0
GROUP BY is2.user_id, ip.id GROUP BY is2.user_id, ip.id
</select> </select>

View File

@ -444,9 +444,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<!-- 接车订单转工单 --> <!-- 接车订单转工单 -->
<if test="inspectionInfo.status == 8"> <if test="inspectionInfo.status == 8">
SELECT imco.*,iisi.content SELECT imco.*
FROM inspection_meet_car_order imco FROM inspection_meet_car_order imco
LEFT JOIN inspection_step_info iisi ON imco.id = iisi.inspection_info_id
WHERE imco.deleted = 0 AND imco.inspection_info_id IS NULL AND imco.is_meet = '1' WHERE imco.deleted = 0 AND imco.inspection_info_id IS NULL AND imco.is_meet = '1'
<!-- 车牌号模糊查询 --> <!-- 车牌号模糊查询 -->
<if test="inspectionInfo.carNum != null"> <if test="inspectionInfo.carNum != null">
@ -652,10 +651,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</where> </where>
</select> </select>
<select id="selectMeetCarList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
SELECT ii.*, imco.meet_type
FROM inspection_info ii
LEFT JOIN inspection_meet_car_order imco ON ii.id = imco.inspection_info_id
WHERE ii.deleted = 0 AND imco.deleted = 0 AND imco.is_meet = '1'
</select>
</mapper> </mapper>

View File

@ -73,7 +73,7 @@
FROM system_users su FROM system_users su
left join system_user_role sur on su.id = sur.user_id left join system_user_role sur on su.id = sur.user_id
left join system_role sr on sur.role_id = sr.id left join system_role sr on sur.role_id = sr.id
inner join inspection_staff iss on iss.user_id = su.id left join inspection_staff iss on iss.user_id = su.id
<where> <where>
sr.service_package_id = 'jiance' and sr.code != 'jcyh' sr.service_package_id = 'jiance' and sr.code != 'jcyh'
and su.id = #{id} and su.id = #{id}