产值导出,bug修改

This commit is contained in:
lcj
2025-11-06 19:26:42 +08:00
parent 359600004d
commit 35c32d68c3
17 changed files with 272 additions and 63 deletions

View File

@ -5,11 +5,14 @@ import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.core.utils.SpringUtils;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.VirtualThreadTaskExecutor; import org.springframework.core.task.VirtualThreadTaskExecutor;
import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/** /**
* 异步配置 * 异步配置
@ -32,6 +35,30 @@ public class AsyncConfig implements AsyncConfigurer {
return SpringUtils.getBean("scheduledExecutorService"); return SpringUtils.getBean("scheduledExecutorService");
} }
/**
* 新增:自定义线程池(可以在 @Async("capturePicExecutor") 使用)
*/
@Bean("capturePicExecutor")
public Executor customExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数
executor.setCorePoolSize(5);
// 最大线程数
executor.setMaxPoolSize(10);
// 队列容量(超过核心线程数时,任务进入队列)
executor.setQueueCapacity(50);
// 空闲线程最大存活时间(秒)
executor.setKeepAliveSeconds(60);
// 线程名前缀,方便定位日志
executor.setThreadNamePrefix("capturePic-async-");
// 拒绝策略:当线程池满时
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// CallerRunsPolicy由调用线程执行任务相对安全
// 初始化
executor.initialize();
return executor;
}
/** /**
* 异步执行异常处理 * 异步执行异常处理
*/ */

View File

@ -96,7 +96,7 @@ public class DashScopeChat {
} }
// 构建生成标题的提示词 // 构建生成标题的提示词
String prompt = String.format(""" String prompt = String.format("""
下面这段用户与AI的对话生成一个简短的标题不超过10个字,并且以陈述句的形式进行总结 以陈述句的形式总结下面这段用户与AI的对话生成一个简短的标题不超过10个字
用户:%s 用户:%s
AI%s AI%s
""", userMessage, aiResponse); """, userMessage, aiResponse);

View File

@ -0,0 +1,70 @@
package org.dromara.bigscreen.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import java.time.LocalDate;
/**
* @author lilemy
* @date 2025-11-06 14:28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MilestoneVo {
/**
* 主键ID
*/
private Long id;
/**
* 节点名称
*/
private String nodeName;
/**
* 对应项目结构
*/
private Long projectStructure;
/**
* 对应项目结构名称
*/
private String projectStructureName;
/**
* 预计开始时间
*/
private LocalDate planStartDate;
/**
* 预计结束时间
*/
private LocalDate planEndDate;
/**
* 实际开始时间
*/
private LocalDate practicalStartDate;
/**
* 实际结束时间
*/
private LocalDate practicalEndDate;
/**
* 状态
*/
private String status;
/**
* 备注
*/
private String remark;
}

View File

@ -0,0 +1,55 @@
package org.dromara.bigscreen.domain.vo;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* @author lilemy
* @date 2025-11-06 10:01
*/
@Data
public class MyProjectInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 2737004515142334438L;
/**
* 项目id
*/
private Long projectId;
/**
* 项目名称
*/
private String projectName;
/**
* 项目概括
*/
private String projectGeneralize;
/**
* 开始时间
*/
private LocalDate StartTime;
/**
* 结束时间
*/
private LocalDate endTime;
/**
* 里程碑
*/
private List<MilestoneVo> milestones;
/**
* 进度
*/
private BigDecimal progress;
}

View File

@ -16,6 +16,11 @@ public class ProjectImageProgressDetailVo implements Serializable {
@Serial @Serial
private static final long serialVersionUID = -8317739851423164942L; private static final long serialVersionUID = -8317739851423164942L;
/**
* 主键
*/
private Long id;
/** /**
* 进度名称 * 进度名称
*/ */
@ -36,4 +41,9 @@ public class ProjectImageProgressDetailVo implements Serializable {
*/ */
private BigDecimal totalProgress; private BigDecimal totalProgress;
/**
* 单位
*/
private String unit;
} }

View File

@ -438,9 +438,15 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
Long projectId = req.getProjectId(); Long projectId = req.getProjectId();
String progressName = req.getProgressName(); String progressName = req.getProgressName();
checkProject(projectId); checkProject(projectId);
// 获取当前项目的所有子级
List<BusProject> subProjects = projectService.lambdaQuery()
.eq(BusProject::getPId, projectId)
.list();
Set<Long> projectIds = subProjects.stream().map(BusProject::getId).collect(Collectors.toSet());
projectIds.add(projectId);
// 获取对应进度 // 获取对应进度
PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery() PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery()
.eq(PgsProgressCategory::getProjectId, projectId) .in(PgsProgressCategory::getProjectId, projectIds)
.eq(PgsProgressCategory::getName, progressName) .eq(PgsProgressCategory::getName, progressName)
.last("limit 1") .last("limit 1")
.one(); .one();
@ -491,6 +497,8 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal) BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo(); ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
vo.setId(c.getId());
vo.setUnit(c.getUnit());
vo.setProgressName(c.getName()); vo.setProgressName(c.getName());
vo.setPlanProgress(plan); vo.setPlanProgress(plan);
vo.setActualProgress(actual); vo.setActualProgress(actual);

View File

@ -49,10 +49,10 @@ public class IncSyncYs7DeviceCapturePicData {
@Resource @Resource
private Ys7Manager ys7Manager; private Ys7Manager ys7Manager;
private final ExecutorService executorService = Executors.newFixedThreadPool(5); private final ExecutorService executorService = Executors.newFixedThreadPool(8);
// 每 15 分钟执行一次 // 每 15 分钟执行一次
@Scheduled(cron = "0 */10 7-19 * * ?") @Scheduled(cron = "0 */15 7-19 * * ?")
public void run() { public void run() {
log.info("执行萤石设备抓拍图片"); log.info("执行萤石设备抓拍图片");
// 获取所有项目的等级信息 // 获取所有项目的等级信息
@ -60,9 +60,8 @@ public class IncSyncYs7DeviceCapturePicData {
.select(HseViolationLevel::getId, HseViolationLevel::getProjectId) .select(HseViolationLevel::getId, HseViolationLevel::getProjectId)
.list(); .list();
Set<Long> projectIds = allLevel.stream().map(HseViolationLevel::getProjectId).collect(Collectors.toSet()); Set<Long> projectIds = allLevel.stream().map(HseViolationLevel::getProjectId).collect(Collectors.toSet());
// 查询所有在线的摄像头设备,仅获取必要字段 // 查询所有在线的摄像头设备
List<OthYs7Device> deviceList = ys7DeviceService.lambdaQuery() List<OthYs7Device> deviceList = ys7DeviceService.lambdaQuery()
.select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName)
.in(OthYs7Device::getProjectId, projectIds) // 仅获取设置了安全等级项目的摄像头 .in(OthYs7Device::getProjectId, projectIds) // 仅获取设置了安全等级项目的摄像头
.eq(OthYs7Device::getStatus, OthDeviceStatusEnum.ONLINE.getValue()) .eq(OthYs7Device::getStatus, OthDeviceStatusEnum.ONLINE.getValue())
.list(); .list();

View File

@ -13,10 +13,10 @@ import java.util.stream.Collectors;
@Getter @Getter
public enum RecognizerTypeEnum { public enum RecognizerTypeEnum {
WEARING_ALL("穿戴安全帽反光衣", "wearingall", "1"), // WEARING_ALL("穿戴安全帽反光衣", "wearingall", "1"),
NO_EQUIPMENT("没穿安全帽反光衣", "noequipment", "2"), // NO_EQUIPMENT("没穿安全帽反光衣", "noequipment", "2"),
NO_HELMET("有反光衣没安全帽", "nohelmet", "3"), NO_HELMET("未戴安全帽", "nohelmet", "3"),
NO_VEST("有安全帽没反光衣", "novest", "4"), NO_VEST("未穿反光衣", "novest", "4"),
SMOKE("吸烟", "smoke", "5"), SMOKE("吸烟", "smoke", "5"),
FIRE("火焰", "fire", "6"), FIRE("火焰", "fire", "6"),
SMOGGY("烟雾", "smoggy", "7"), SMOGGY("烟雾", "smoggy", "7"),

View File

@ -27,6 +27,11 @@ public class OthYs7DeviceImg implements Serializable {
@TableId(value = "id") @TableId(value = "id")
private Long id; private Long id;
/**
* 项目id
*/
private Long projectId;
/** /**
* 设备序列号 * 设备序列号
*/ */

View File

@ -18,6 +18,11 @@ public class OthYs7DeviceImgQueryReq implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 5264959525029608917L; private static final long serialVersionUID = 5264959525029608917L;
/**
* 项目id
*/
private Long projectId;
/** /**
* 设备序列号 * 设备序列号
*/ */

View File

@ -32,6 +32,11 @@ public class OthYs7DeviceImgVo implements Serializable {
@ExcelProperty(value = "主键id") @ExcelProperty(value = "主键id")
private Long id; private Long id;
/**
* 项目id
*/
private Long projectId;
/** /**
* 设备序列号 * 设备序列号
*/ */

View File

@ -39,6 +39,7 @@ import org.dromara.safety.service.IHseViolationLevelService;
import org.dromara.system.domain.vo.SysOssUploadVo; import org.dromara.system.domain.vo.SysOssUploadVo;
import org.dromara.system.service.ISysOssService; import org.dromara.system.service.ISysOssService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -146,9 +147,11 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe
if (req == null) { if (req == null) {
return lqw; return lqw;
} }
Long projectId = req.getProjectId();
String deviceSerial = req.getDeviceSerial(); String deviceSerial = req.getDeviceSerial();
String deviceName = req.getDeviceName(); String deviceName = req.getDeviceName();
Date createTime = req.getCreateTime(); Date createTime = req.getCreateTime();
lqw.eq(projectId != null, OthYs7DeviceImg::getProjectId, projectId);
lqw.like(StringUtils.isNotBlank(deviceSerial), OthYs7DeviceImg::getDeviceSerial, deviceSerial); lqw.like(StringUtils.isNotBlank(deviceSerial), OthYs7DeviceImg::getDeviceSerial, deviceSerial);
lqw.like(StringUtils.isNotBlank(deviceName), OthYs7DeviceImg::getDeviceName, deviceName); lqw.like(StringUtils.isNotBlank(deviceName), OthYs7DeviceImg::getDeviceName, deviceName);
if (createTime != null) { if (createTime != null) {
@ -194,7 +197,12 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe
vo.setUrl(deviceImg.getRecognizeUrl()); vo.setUrl(deviceImg.getRecognizeUrl());
} }
List<String> recTypeList = JSONUtil.toList(deviceImg.getRecType(), String.class); List<String> recTypeList = JSONUtil.toList(deviceImg.getRecType(), String.class);
List<String> list = recTypeList.stream().map(recType -> Objects.requireNonNull(RecognizerTypeEnum.fromValue(recType)).getText()).toList(); List<String> list = recTypeList.stream()
.map(recType -> {
RecognizerTypeEnum type = RecognizerTypeEnum.fromValue(recType);
return type != null ? type.getText() : "未知类型";
})
.toList();
vo.setRecTypeList(list); vo.setRecTypeList(list);
return vo; return vo;
}).toList(); }).toList();
@ -208,6 +216,7 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe
* @param imgList 抓拍图片列表 * @param imgList 抓拍图片列表
*/ */
@Override @Override
@Async("capturePicExecutor")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void saveCapturePic(List<OthYs7DeviceImgCreateByCapture> imgList) { public void saveCapturePic(List<OthYs7DeviceImgCreateByCapture> imgList) {
List<OthYs7DeviceImg> saveList = new ArrayList<>(); List<OthYs7DeviceImg> saveList = new ArrayList<>();
@ -245,6 +254,7 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe
SysOssUploadVo uploadVo = ossService.uploadFileUrlWithNoSave(url, deviceImgOssPath); SysOssUploadVo uploadVo = ossService.uploadFileUrlWithNoSave(url, deviceImgOssPath);
String ossUrl = uploadVo.getUrl(); String ossUrl = uploadVo.getUrl();
if (StringUtils.isNotBlank(ossUrl)) { if (StringUtils.isNotBlank(ossUrl)) {
othYs7DeviceImg.setProjectId(img.getProjectId());
othYs7DeviceImg.setDeviceSerial(deviceSerial); othYs7DeviceImg.setDeviceSerial(deviceSerial);
othYs7DeviceImg.setCreateTime(img.getCreateTime()); othYs7DeviceImg.setCreateTime(img.getCreateTime());
othYs7DeviceImg.setDeviceName(img.getDeviceName()); othYs7DeviceImg.setDeviceName(img.getDeviceName());
@ -296,21 +306,24 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe
record.setPicture(targetUrl); record.setPicture(targetUrl);
record.setRecordCategory(HseRecordCategoryEnum.MONITOR.getValue()); record.setRecordCategory(HseRecordCategoryEnum.MONITOR.getValue());
record.setProjectId(img.getProjectId()); record.setProjectId(img.getProjectId());
// 保存识别记录
recognizeRecordService.saveByMonitor(List.of(record));
recordList.add(record); recordList.add(record);
} }
// 保存抓拍记录
boolean save = this.save(othYs7DeviceImg);
if (!save) {
log.error("保存图片失败:{}", othYs7DeviceImg);
}else {
saveList.add(othYs7DeviceImg); saveList.add(othYs7DeviceImg);
} }
} }
if (CollUtil.isNotEmpty(saveList)) {
log.info("批量保存抓拍图片开始,共:{} 张", saveList.size());
boolean result = saveBatch(saveList);
if (!result) {
throw new ServiceException("批量新增图片失败,数据库异常", HttpStatus.ERROR);
} }
if (CollUtil.isNotEmpty(saveList)) {
log.info("批量保存抓拍图片完成,共:{} 张", saveList.size());
} }
if (CollUtil.isNotEmpty(recordList)) { if (CollUtil.isNotEmpty(recordList)) {
log.info("批量保存识别记录开始,共:{} 条", recordList.size()); log.info("批量保存识别记录完成,共:{} 条", recordList.size());
recognizeRecordService.saveByMonitor(recordList);
} }
} }

View File

@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data; import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation; import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant; import org.dromara.common.translation.constant.TransConstant;
import org.dromara.out.domain.OutConstructionValue; import org.dromara.out.domain.OutConstructionValue;
@ -31,7 +33,6 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 主键ID * 主键ID
*/ */
@ExcelProperty(value = "主键ID")
private Long id; private Long id;
/** /**
@ -42,7 +43,6 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 项目ID * 项目ID
*/ */
@ExcelProperty(value = "项目ID")
private Long projectId; private Long projectId;
/** /**
@ -54,19 +54,17 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 子项目ID * 子项目ID
*/ */
@ExcelProperty(value = "子项目ID")
private Long subProjectId; private Long subProjectId;
/** /**
* 子项目名 * 子项目名
*/ */
@ExcelProperty(value = "子项目名") @ExcelProperty(value = "项目子项")
private String subProjectName; private String subProjectName;
/** /**
* 方阵id * 方阵id
*/ */
@ExcelProperty(value = "方阵id")
private Long matrixId; private Long matrixId;
/** /**
@ -78,7 +76,6 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 分部工程id * 分部工程id
*/ */
@ExcelProperty(value = "分部工程id")
private Long categoryId; private Long categoryId;
/** /**
@ -90,7 +87,6 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 分项工程id * 分项工程id
*/ */
@ExcelProperty(value = "分项工程id")
private Long progressCategoryId; private Long progressCategoryId;
/** /**
@ -104,6 +100,19 @@ public class OutConstructionValueVo implements Serializable {
*/ */
private Long detailId; private Long detailId;
/**
* 上报日期
*/
@ExcelProperty(value = "上报日期")
private LocalDate reportDate;
/**
* 计量方式0无 1数量 2百分比
*/
@ExcelProperty(value = "计量方式", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=无,1=数量,2=百分比")
private String unitType;
/** /**
* 人工填报数量 * 人工填报数量
*/ */
@ -116,12 +125,6 @@ public class OutConstructionValueVo implements Serializable {
@ExcelProperty(value = "无人机识别数量") @ExcelProperty(value = "无人机识别数量")
private Integer uavNum; private Integer uavNum;
/**
* 确认数量
*/
@ExcelProperty(value = "确认数量")
private Integer confirmNum;
/** /**
* 计划数量 * 计划数量
*/ */
@ -130,25 +133,39 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 综合单价(业主) * 综合单价(业主)
*/ */
@ExcelProperty(value = "综合单价(业主)")
private BigDecimal ownerPrice; private BigDecimal ownerPrice;
/** /**
* 综合单价(分包) * 综合单价(分包)
*/ */
@ExcelProperty(value = "综合单价(分包)")
private BigDecimal constructionPrice; private BigDecimal constructionPrice;
/**
* 确认数量
*/
@ExcelProperty(value = "确认数量")
private Integer confirmNum;
/**
* 单位
*/
@ExcelProperty(value = "单位")
private String unit;
/**
* 对甲产值
*/
@ExcelProperty(value = "对甲产值")
private BigDecimal ownerValue;
/** /**
* 产值 * 产值
*/ */
@ExcelProperty(value = "产值") @ExcelProperty(value = "对乙产值")
private BigDecimal outValue; private BigDecimal outValue;
/**
* 上报日期
*/
@ExcelProperty(value = "上报日期")
private LocalDate reportDate;
/** /**
* 计划日期 * 计划日期
*/ */
@ -157,7 +174,6 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 审核状态 * 审核状态
*/ */
@ExcelProperty(value = "审核状态")
private String auditStatus; private String auditStatus;
/** /**
@ -168,30 +184,14 @@ public class OutConstructionValueVo implements Serializable {
/** /**
* 上报人 * 上报人
*/ */
@ExcelProperty(value = "上报人")
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy") @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
private String createByName; private String createByName;
/**
* 对甲产值
*/
private BigDecimal ownerValue;
/** /**
* 工作类型 * 工作类型
*/ */
private String workType; private String workType;
/**
* 计量方式0无 1数量 2百分比
*/
private String unitType;
/**
* 单位
*/
private String unit;
/** /**
* 完成数量 * 完成数量
*/ */

View File

@ -168,7 +168,6 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
// 获取当前进度数量和完成数量总和 // 获取当前进度数量和完成数量总和
BigDecimal total = progressCategory.getTotal(); BigDecimal total = progressCategory.getTotal();
PgsProgressCategoryLastTimeVo lastTimeVo = new PgsProgressCategoryLastTimeVo(); PgsProgressCategoryLastTimeVo lastTimeVo = new PgsProgressCategoryLastTimeVo();
;
if (total.compareTo(BigDecimal.ZERO) > 0) { if (total.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal allNumber = progressPlanService.getCurrentPlanAndFinishedNumber(progressCategory); BigDecimal allNumber = progressPlanService.getCurrentPlanAndFinishedNumber(progressCategory);
total = PgsProgressUnitTypeEnum.PERCENTAGE.getValue().equals(progressCategory.getUnitType()) ? total = PgsProgressUnitTypeEnum.PERCENTAGE.getValue().equals(progressCategory.getUnitType()) ?

View File

@ -71,4 +71,9 @@ public class VehVehicleTripQueryReq implements Serializable {
*/ */
private String tripStatus; private String tripStatus;
/**
* 车牌号
*/
private String plateNumber;
} }

View File

@ -198,6 +198,7 @@ public class VehVehicleTripServiceImpl extends ServiceImpl<VehVehicleTripMapper,
lqw.eq(req.getProjectId() != null, VehVehicleTrip::getProjectId, req.getProjectId()); lqw.eq(req.getProjectId() != null, VehVehicleTrip::getProjectId, req.getProjectId());
lqw.like(StringUtils.isNotBlank(req.getStartPlace()), VehVehicleTrip::getStartPlace, req.getStartPlace()); lqw.like(StringUtils.isNotBlank(req.getStartPlace()), VehVehicleTrip::getStartPlace, req.getStartPlace());
lqw.like(StringUtils.isNotBlank(req.getEndPlace()), VehVehicleTrip::getEndPlace, req.getEndPlace()); lqw.like(StringUtils.isNotBlank(req.getEndPlace()), VehVehicleTrip::getEndPlace, req.getEndPlace());
lqw.like(StringUtils.isNotBlank(req.getPlateNumber()), VehVehicleTrip::getPlateNumber, req.getPlateNumber());
lqw.ge(req.getPeopleNum() != null, VehVehicleTrip::getPeopleNum, req.getPeopleNum()); lqw.ge(req.getPeopleNum() != null, VehVehicleTrip::getPeopleNum, req.getPeopleNum());
lqw.eq(req.getReviewStatus() != null, VehVehicleTrip::getReviewStatus, req.getReviewStatus()); lqw.eq(req.getReviewStatus() != null, VehVehicleTrip::getReviewStatus, req.getReviewStatus());
lqw.eq(req.getTripStatus() != null, VehVehicleTrip::getTripStatus, req.getTripStatus()); lqw.eq(req.getTripStatus() != null, VehVehicleTrip::getTripStatus, req.getTripStatus());

View File

@ -5,6 +5,8 @@
<mapper namespace="org.dromara.vehicle.mapper.VehVehicleTripMapper"> <mapper namespace="org.dromara.vehicle.mapper.VehVehicleTripMapper">
<select id="selectVehicleTripPage" resultType="org.dromara.vehicle.domain.vo.VehVehicleTripVo"> <select id="selectVehicleTripPage" resultType="org.dromara.vehicle.domain.vo.VehVehicleTripVo">
SELECT *
FROM (
SELECT SELECT
id, id,
project_id, project_id,
@ -91,9 +93,8 @@
), 2) AS total_score ), 2) AS total_score
FROM veh_vehicle_trip FROM veh_vehicle_trip
where left_seat > 0
-- 只保留总评分 >= 60 的数据 WHERE left_seat > 0
and total_score >= 60
<if test="req.projectId != null"> <if test="req.projectId != null">
AND project_id = #{req.projectId} AND project_id = #{req.projectId}
</if> </if>
@ -103,8 +104,14 @@
<if test="req.tripStatus != null"> <if test="req.tripStatus != null">
AND trip_status = #{req.tripStatus} AND trip_status = #{req.tripStatus}
</if> </if>
<if test="req.plateNumber != null">
AND plate_number LIKE CONCAT('%', #{req.plateNumber}, '%')
</if>
) AS t
ORDER BY total_score DESC WHERE t.total_score >= 60
ORDER BY t.total_score DESC
</select> </select>