liujie
2026-03-11 5fc29674d6f1e3349efe8430a3bca5487e5689e7
修改bug
3个文件已修改
63 ■■■■■ 已修改文件
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpSchedulingDetailMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
@@ -33,14 +33,16 @@
import com.xiaopeng.maintenance.service.IXpShiftService;
import com.xiaopeng.maintenance.vo.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -571,9 +573,17 @@
        LocalDate parse1 = LocalDate.parse(month + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        int dayOfMonth = parse1.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
        HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
        HSSFCellStyle cellStyle = hssfWorkbook.createCellStyle();
        cellStyle.setAlignment(HorizontalAlignment.CENTER);
        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
        HSSFSheet hssfSheet = hssfWorkbook.createSheet();
        hssfSheet.setColumnWidth(0, 6 * 256);
        hssfSheet.setDefaultRowHeightInPoints(20f);
        HSSFCellStyle cellStyle1 = hssfWorkbook.createCellStyle();
        cellStyle1.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.index);
        cellStyle1.setAlignment(HorizontalAlignment.CENTER);
        cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
        //添加第一行标题
        HSSFRow hssfRow = hssfSheet.createRow(0);
@@ -584,13 +594,14 @@
        //设置表头样式,合并单元格
        CellRangeAddress region = new CellRangeAddress(0, 1, 0, 0);
        hssfSheet.addMergedRegion(region);
        region = new CellRangeAddress(0, 1, dayOfMonth + 1, totalCell);
        region = new CellRangeAddress(0, 1, dayOfMonth + 1, totalCell - 1);
        hssfSheet.addMergedRegion(region);
        //设置单元格数据
        for (int i = 0; i < totalCell; i++) {
            HSSFCell cell = hssfRow.createCell(i);
            cell.setCellStyle(cellStyle1);
            if(0 == i){
                cell.setCellValue("车队");
            }else if(i <= dayOfMonth){
@@ -605,6 +616,7 @@
        //设置单元格数据
        for (int i = 0; i < totalCell; i++) {
            HSSFCell cell = hssfRow1.createCell(i);
            cell.setCellStyle(cellStyle1);
            if(i > 0 && i <= dayOfMonth){
                LocalDate parse = LocalDate.parse(month + "-" + String.format("%02d", i), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                String week = "";
@@ -638,7 +650,9 @@
        int rowNum = 2;
        for (SchedulingDetailDto schedulingDetailDto : schedulingDetailDtos) {
            HSSFRow row = hssfSheet.createRow(rowNum);
            row.createCell(0).setCellValue(schedulingDetailDto.getFleetName());
            HSSFCell cell = row.createCell(0);
            cell.setCellStyle(cellStyle);
            cell.setCellValue(schedulingDetailDto.getFleetName());
            String days = schedulingDetailDto.getDays();
            if (StringUtils.isNotBlank(days)) {
@@ -654,17 +668,30 @@
                        }
                    }
                    row.createCell(i).setCellValue(shiftName);
                    HSSFCell cell1 = row.createCell(i);
                    cell1.setCellValue(shiftName);
                }
                for (int i = 0; i < xpShifts.size(); i++) {
                    String shiftName = xpShifts.get(i).getShiftName();
                    long allDay = list.stream().filter(s -> s.contains(shiftName)).count();
                    row.createCell(dayOfMonth + 1 + i).setCellValue(allDay + allDay);
                    HSSFCell cell1 = row.createCell(dayOfMonth + 1 + i);
                    cell1.setCellStyle(cellStyle);
                    cell1.setCellValue(shiftName + " " + allDay);
                }
            }
            rowNum++;
        }
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("排班计划管理.xls", "UTF-8"));
            ServletOutputStream outputStream = response.getOutputStream();
            hssfWorkbook.write(outputStream);
            outputStream.flush();
            outputStream.close();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpSchedulingDetailMapper.xml
@@ -15,7 +15,7 @@
            a.fleet_id, GROUP_CONCAT(concat(DATE_FORMAT(a.plan_time, '%d' ), '_', a.shift_id, '_', b.shift_name, '_', b.shift_color)) as days
            from xp_scheduling_detail a
            left join xp_shift b on (a.shift_id = b.id)
            where a.is_deleted = 0 and DATE_FORMAT(a.plan_time, '%Y-%m') = #{month}
            where a.is_deleted = 0 and b.is_deleted = 0 and DATE_FORMAT(a.plan_time, '%Y-%m') = #{month}
            group by a.fleet_id
        ) AS bb ON ( aa.id = bb.fleet_id)
        WHERE aa.is_deleted = 0
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -131,13 +131,13 @@
        // 检查新区域与现有运营区域是否有重叠
        for (XpElectronicFenceArea newArea : newElectronicFenceAreas) {
            //处理围栏闭合
            String[] split = newArea.getFencePoints().split(",");
            if(!split[0].equals(split[split.length - 1])){
                newArea.setFencePoints(newArea.getFencePoints() + "," + split[0]);
            }
            if (newArea.getAreaType() == 1) { // 只检查运营区域
                for (XpElectronicFenceArea existingArea : existingOperationAreas) {
                    //处理围栏闭合
                    String[] split = existingArea.getFencePoints().split(",");
                    if(split[0].equals(split[split.length - 1])){
                        existingArea.setFencePoints(existingArea.getFencePoints() + "," + split[0]);
                    }
                    if (polygonOverlapService.checkPolygonOverlap(
                            newArea.getFencePoints(),
                            existingArea.getFencePoints())) {
@@ -320,13 +320,13 @@
            // 检查更新后的区域与现有运营区域是否有重叠
            for (XpElectronicFenceArea updatedArea : updatedElectronicFenceAreas) {
                //处理围栏闭合
                String[] split = updatedArea.getFencePoints().split(",");
                if(!split[0].equals(split[split.length - 1])){
                    updatedArea.setFencePoints(updatedArea.getFencePoints() + "," + split[0]);
                }
                if (updatedArea.getAreaType() == 1) { // 只检查运营区域
                    for (XpElectronicFenceArea existingArea : existingOperationAreas) {
                        //处理围栏闭合
                        String[] split = existingArea.getFencePoints().split(",");
                        if(split[0].equals(split[split.length - 1])){
                            existingArea.setFencePoints(existingArea.getFencePoints() + "," + split[0]);
                        }
                        if (polygonOverlapService.checkPolygonOverlap(
                                updatedArea.getFencePoints(),
                                existingArea.getFencePoints())) {