liujie
2026-03-12 47e4baada1437267f7fb524160ea9ad87af86b08
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
3个文件已修改
60 ■■■■■ 已修改文件
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpClockInMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpClockInMapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpClockInMapper.java
@@ -57,4 +57,9 @@
                                                                  @Param("appUserId") Long appUserId,
                                                                  @Param("startTime") String startTime,
                                                                  @Param("endTime") String endTime);
    Long getClockInStatisticsDetailsCount(@Param("state") Integer state, @Param("appUserId") Long appUserId,
                                        @Param("startTime") String startTime,
                                        @Param("endTime") String endTime);
}
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java
@@ -290,10 +290,6 @@
                    clockInStatistic.setRoleName(roleName);
                }
            }
            Integer shouldClockInDays = clockInStatistic.getShouldClockInDays();
            Integer clockInDays = clockInStatistic.getClockInDays();
            Integer lateEarly = clockInStatistic.getLateEarly();
            clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly);
        }
        pageInfo.setRecords(clockInStatistics);
        return pageInfo;
@@ -362,10 +358,6 @@
                    clockInStatistic.setRoleName(roleName);
                }
            }
            Integer shouldClockInDays = clockInStatistic.getShouldClockInDays();
            Integer clockInDays = clockInStatistic.getClockInDays();
            Integer lateEarly = clockInStatistic.getLateEarly();
            clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly);
        }
        ExcelUtil<ClockInStatisticsDto> excel = new ExcelUtil<ClockInStatisticsDto>(ClockInStatisticsDto.class);
@@ -406,16 +398,10 @@
        XpOperationsUser xpOperationsUser = xpOperationUserClient.queryById(query.getAppUserId()).getData();
        List<Long> longList = fleetOperationsClient.getFleetIdsByUserId(xpOperationsUser.getId()).getData();
        List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleet_id", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime));
        QueryWrapper<XpClockIn> last1 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 1 or clock_out_result = 1)"
                + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : ""));
        QueryWrapper<XpClockIn> last2 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 2 or clock_out_result = 2)"
                + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : ""));
        QueryWrapper<XpClockIn> last3 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 3 or clock_out_result = 3)"
                + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : ""));
        dto.setShouldClockInCount(list.size() * 2);
        dto.setNormalClockInCount(this.count(last1));
        dto.setLateClockInCount(this.count(last2));
        dto.setMissingClockInCount(this.count(last3));
        dto.setNormalClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(1, query.getAppUserId(), startTime, endTime));
        dto.setLateClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(2, query.getAppUserId(), startTime, endTime));
        dto.setMissingClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(3, query.getAppUserId(), startTime, endTime));
        return dto;
    }
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpClockInMapper.xml
@@ -48,9 +48,10 @@
        cc.fleet_name as teamName,
        ifnull(sum(aa.num1), 0) as clockInDays,
        ifnull(sum(aa.num2), 0) as lateEarly,
        ifnull(sum(aa.num3), 0) as notClockInDays,
        ifnull(dd.num1, 0) as shouldClockInDays
        from (
            select app_user_id, count(id) as num1, 0 as num2 from xp_clock_in where is_deleted = 0 and
            select app_user_id, count(id) as num1, 0 as num2, 0 as num3 from xp_clock_in where is_deleted = 0 and
            clock_in_result = 1 and clock_out_result = 1
            <if test="null != appUserIds and appUserIds.size() > 0">
                and app_user_id in
@@ -63,8 +64,21 @@
            </if>
            group by app_user_id
            union all
            select app_user_id, 0 as num1, count(id) as num2 from xp_clock_in where is_deleted = 0 and
            (clock_in_result != 1 or clock_out_result != 1)
            select app_user_id, 0 as num1, count(id) as num2, 0 as num3 from xp_clock_in where is_deleted = 0 and
            (clock_in_result = 2 or clock_out_result = 2)
            <if test="null != appUserIds and appUserIds.size() > 0">
                and app_user_id in
                <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index">
                    #{item}
                </foreach>
            </if>
            <if test="null != startTime and '' != startTime and null != endTime and '' != endTime">
                and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime}
            </if>
            group by app_user_id
            union all
            select app_user_id, 0 as num1, 0 as num2, count(id) as num3 from xp_clock_in where is_deleted = 0 and
            (clock_in_result = 3 or clock_out_result = 3)
            <if test="null != appUserIds and appUserIds.size() > 0">
                and app_user_id in
                <foreach item="item" collection="appUserIds" separator="," open="(" close=")" index="index">
@@ -103,10 +117,23 @@
        left join xp_fleet_operations b on (a.app_user_id = b.operations_user_id)
        left join xp_fleet c on (b.fleet_id = c.id)
        left join xp_shift d on (a.shift_id = d.id)
        WHERE a.app_user_id = #{appUserId}
        WHERE a.app_user_id = #{appUserId} and a.is_deleted = 0
        <if test="null != startTime and '' != startTime and null != endTime and '' != endTime">
            and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime}
        </if>
        order by a.clock_in_time desc
    </select>
    <select id="getClockInStatisticsDetailsCount" resultType="long">
        select count(id) from (
        select id from xp_clock_in where is_deleted = 0 and app_user_id = #{appUserId} and clock_out_result = #{state}
        <if test="null != startTime and '' != startTime and null != endTime and '' != endTime">
            and DATE_FORMAT(clock_out_time, '%Y-%m-%d') between #{startTime} and #{endTime}
        </if>union ALL
          select id from xp_clock_in where is_deleted = 0 and app_user_id = #{appUserId} and clock_in_result = #{state}
        <if test="null != startTime and '' != startTime and null != endTime and '' != endTime">
            and DATE_FORMAT(clock_in_time, '%Y-%m-%d') between #{startTime} and #{endTime}
        </if>
        ) as aa
    </select>
</mapper>